New "record" error when no "Records" exist..

MackMan

Registered User.
Local time
Today, 09:32
Joined
Nov 25, 2014
Messages
174
What I've done is setfocus from another subform to this subform, and I want to add a new record.

I've got my code mixed up somewhere along the line as it's saying "the command or action 'RecordsGoToNew isn't available now.

I'm trying to setfocus to this form, create a new record and setfocus to a field within the focussed form.

The code I'm currently using is...

Forms!frmtopline!frmTopLineSub.SetFocus
RunCommand acCmdRecordsGoToNew
Forms!frmtopline!frmTopLineSub.Form!TransactionDate.SetFocus


Is this right?
 
Last edited:
On the form OnCurrent event, test the record primary key, if it's null, there's no record.
 
Try the more usual command:

DoCmd.GoToRecord , , acNewRec
 

Users who are viewing this thread

Back
Top Bottom