Add new record to subform

  • Thread starter Thread starter JustinP
  • Start date Start date
J

JustinP

How is this done? I can't seem to get it too work...

I'm using:

Me!Forms!MasterOwner!DoCmd.GoToRecord , , acNewRec
 
Try:
Me!Forms!MasterOwner!Form!SomeControlInTheForm.SetFocus()
DoCmd.GoToRecord , , acNewRec

on two seperate lines.

Barry
 
I get the error message:
....can't find the field "Forms" refered to your expression.

I used:
Me!Forms!frmCORRESPONDENCE!Form!txtITEM.SetFocus
DoCmd.GoToRecord , , acNewRec

Thanks
 
I get the error message:
...can't find the field "Forms" refered to your expression.

I used:
Me!Forms!frmCORRESPONDENCE!Form!txtITEM.SetFocus
DoCmd.GoToRecord , , acNewRec

Thanks

Belt and suspenders!

Me!

and

Forms!frmCORRESPONDANCE

both mean the same thing (assuming that this is frmCORRESPONDANCE
you're working on).

Use one or the other - not both.

John W. Vinson[MVP]
 
You're right, thanks.

It now says "Can't go to the specified record"

I'm using:

Forms![frmCORRESPONDENCE].Form![subfrmCorrespondence].Form![txtITEM].SetFocus
DoCmd.GoToRecord , , acNewRec

Any ideas?
 
Worked it out. Needed to set AllowAdditions for both main form and
subform. Thanks for your help.

You're right, thanks.

It now says "Can't go to the specified record"

I'm using:

Forms![frmCORRESPONDENCE].Form![subfrmCorrespondence].Form![txtITEM].SetFocus
DoCmd.GoToRecord , , acNewRec

Any ideas?


John said:
Belt and suspenders!

Me!

and

Forms!frmCORRESPONDANCE

both mean the same thing (assuming that this is frmCORRESPONDANCE
you're working on).

Use one or the other - not both.

John W. Vinson[MVP]
 
Worked it out. Needed to set AllowAdditions for both main form and
subform. Thanks for your help.

Yep... if you want to add a new record, you do! It's not instantly
obvious that BOTH forms need it to be true, but IIRC they do.

John W. Vinson[MVP]
 
Back
Top