DoCmd.GoToRecord

casey

Registered User.
Local time
Today, 18:11
Joined
Dec 5, 2000
Messages
448
Hello,

I'm trying to use the DoCmd.GoToRecord command on a subform to go to a new record. (DoCmd.GoToRecord acDataForm, "OrderPartsSub", acNew)
An error message appears saying that the subform isn't open.
Any ideas what I'm doing wrong here?
 
I am pretty sure that you will need to declare the name of the host form then the subform i.e. "frmMainForm.frmSubForm".
 
DoCmd.Go To Control subformName
DoCmd.Go To Record etc, you might find it easier to create a macro to do this initially and then convert it to vba.
HTH
 
Thanks for the reply, DRananahan. But it still says that the subform is not open.
Any other ideas?

[This message has been edited by casey (edited 06-11-2001).]
 
Forms!MainForm!Subform.SetFocus
DoCmd.GoToRecord , , acNewRec

HTH
 
Thanks to everyone. What finally worked was to set the subform's DataEntry property to true before I updated it. This seems to do what I need.
I have a feeling that what you all suggest(GotoRecord, , acNew) should have worked and is what I really need to do, but for some reason, it doesn't seem to work in Access 2000.
Thanks again.
 

Users who are viewing this thread

Back
Top Bottom