The subform name is 'CreditorsSUB' and the data therein based on
'QryCreditorTrans'.
In the properties dialogue I have set the 'Data Entry' to 'Yes' but still
the form refuses to display a new blank record.
I've had to solve the problem by using the wizard to place a button on the
subform with the "GotoLast" option (there being no "GotoNew") and then
altering the code behind the wizard's button as follows:
***
Private Sub Command23_Click()
On Error GoTo Err_Command23_Click
DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acNext
Exit_Command23_Click:
Exit Sub
End Sub
***
And now when I press this button I get the desired result.
But this seems a round-about way of doing it, so can someone help me with a
better way? Regards Frank
If Me.Dirty Then 'Save any edits first.
Me.Dirty = False
End If
If Not Me.NewRecord Then
RunCommand acCmdRecordsGotoNew
End If
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Frank Martin" <pa...@colonel.com.au> wrote in message
news:e8ZGmlm...@TK2MSFTNGP15.phx.gbl...
The subform in question is linked to a Combobox with the Child/Master
properties of the subform and this will give all the records for the name
selected in the combobox.
However if there are no records for a particular name I get an error message
"RunCommand acCmdRecordsGoToNew is not available now."
How can I get the new record in the subform even if there are no records in
it.
PS I have already set the DataEntry property for the subform datasheet to
'Yes' but this has no effect - is there some occasions when this will not
work?
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:uOyyWkoM...@TK2MSFTNGP14.phx.gbl...
If you have only the new record row, then I fail to see the point of trying
to move to the new record row, because you are already there. Is is possible
that you are seeing the Default Value entries in the contorls, and not
recognising that you are already at the new record row?
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Frank Martin" <pa...@colonel.com.au> wrote in message
news:e4LhpeyM...@TK2MSFTNGP15.phx.gbl...
It works well when the form is accessed directly in the form-objects screen,
and fails completely when this table is within the subform.
This has never happened before.
I amtrying to circumvent this problem by using the "RunCommand
acCmdRecordsGoToNew" and similar codes, though I would rather not.
Regatds, Frank
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:e4o7L1yM...@TK2MSFTNGP15.phx.gbl...
Unusual request, but try turning the subform's DataEntry off again (since it
does not work as expected), and set its RecordSource to a query that returns
no records. Example:
SELECT Table1.* FROM Table1 WHERE (False);
Naturally this returns no records, so you are instantly taken to the new
record. If you enter a record stays visible until you move record. Is that
the behavior you wanted?
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Frank Martin" <pa...@colonel.com.au> wrote in message
news:ukrGOa1M...@TK2MSFTNGP12.phx.gbl...
*****
Private Sub CreditorsSuppTxnsSUB_Enter()
If Me.NewRecord = True Then
Me.[CreditorsSuppTxnsSUB].[Form]![AddressesID].SetFocus
Else
DoCmd.RunCommand acCmdRecordsGoToNew
Me.[CreditorsSuppTxnsSUB].[Form]![AddressesID].SetFocus
End If
*******
but this dosn't work!
Can you see anything wrong with the above?
Regards.
End Sub
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:uoBlnZ2M...@tk2msftngp13.phx.gbl...
Did you intend this:
Private Sub CreditorsSuppTxnsSUB_Enter()
Me.CreditorsSuppTxnsSUB.Form!AddressesID.SetFocus
If Not Me.CreditorsSuppTxnsSUB.Form.NewRecord Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
End Sub
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Frank Martin" <pa...@colonel.com.au> wrote in message
news:%23eHmgQC...@TK2MSFTNGP15.phx.gbl...
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:OaqpcBDN...@TK2MSFTNGP09.phx.gbl...