You can't go to a new record if you are already at one. There is a NewRecord
property of a form that you can check first (aircode):
Sub Form_Current()
If Me.NewRecord = True Then
Me.FirstControlName.SetFocus
Else
DoCmd.RunCommand acCmdRecordsGoToNew
Me.FirstControlName.SetFocus
End If
End Sub

Signature
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
> I have a subform "SuppTxnsSUB" based on the tblSuppTxns, and a particular
> supplier's transactions are selected vis a plain combo box (no wizard) by
[quoted text clipped - 22 lines]
>
> Plesae help, Frank
Frank Martin - 29 Mar 2005 06:59 GMT
Thank you. I have tried this code (as several variations) to no avail.
The best I have come up with is:
*****
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
End Sub
********
which stubbornly refuses to work.
I wonder if you can give me some fresh ideas?
Regards.
> You can't go to a new record if you are already at one. There is a
> NewRecord
[quoted text clipped - 37 lines]
>>
>> Plesae help, Frank
Andreas - 29 Mar 2005 07:28 GMT
If Me.NewRecord = True
You are checking the mainform, rather than the subform.
Try something like (untested):
If Me.[CreditorsSuppTxnsSUB].[Form].NewRecord = True
Same goes for adding a new record.
Regards,
Andreas
> Thank you. I have tried this code (as several variations) to no avail.
>
[quoted text clipped - 60 lines]
>>>
>>>Plesae help, Frank
Frank Martin - 29 Mar 2005 08:52 GMT
Thanks, I have settled on:
*****
Private Sub CreditorsSuppTxnsSUB_Enter()
Me.CreditorsSuppTxnsSUB.Form!AddressesID.SetFocus
If Not Me.CreditorsSuppTxnsSUB.Form.NewRecord Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
End Sub
*******
Which works rather well
> If Me.NewRecord = True
> You are checking the mainform, rather than the subform.
[quoted text clipped - 75 lines]
>>>>
>>>>Plesae help, Frank