DoCmd.GoToRecord (1 Viewer)

casey

Registered User.
Local time
Today, 23:10
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?
 

DRananahan

Registered User.
Local time
Today, 23:10
Joined
Jul 24, 2000
Messages
14
I am pretty sure that you will need to declare the name of the host form then the subform i.e. "frmMainForm.frmSubForm".
 
R

Rich

Guest
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
 

casey

Registered User.
Local time
Today, 23:10
Joined
Dec 5, 2000
Messages
448
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).]
 

KevinM

Registered User.
Local time
Today, 23:10
Joined
Jun 15, 2000
Messages
719
Forms!MainForm!Subform.SetFocus
DoCmd.GoToRecord , , acNewRec

HTH
 

casey

Registered User.
Local time
Today, 23:10
Joined
Dec 5, 2000
Messages
448
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

Top Bottom