Goto new record on subform

le888

Registered User.
Local time
Today, 08:51
Joined
Dec 10, 2003
Messages
344
Hi,

I have a main form and a subform which is unbound. I have also, a command button on the main form which when Click on it, it should goto an empty record on the subform. I have try

DoCmd.GoToRecord , , acNewRec

This didn't do the job. How do I do this? Any ideas?

Thanks,

Le
 
Try pasting this code

Me.Your Subform Name.SetFocus
DoCmd.GoToRecord , , acNewRec

Michael
 
Ukraine82 said:
Try pasting this code

Me.Your Subform Name.SetFocus
DoCmd.GoToRecord , , acNewRec

Michael
No do it this way:
Code:
DoCmd.GoToRecord acDataForm, [COLOR=Red][I]"Sub Form Name"[/I][/COLOR], acNewRec

Edit: When I say sub form name I'm talking about the name of the form not the subform object.
 
Last edited:
Thanks, unfortunaly I got a message said that my subform is not open. So, how can I deal with this?

Le
 
le888 said:
Thanks, unfortunaly I got a message said that my subform is not open. So, how can I deal with this?

Le
Ignore what I said and do what Ukraine82 said:o Not paying attention sorry. :o :o
 
Me.ctlYour Subform Name.SetFocus
DoCmd.GoToRecord , , acNewRec

For office 2010 you must add ctl before your subform name
 
I have a main form and a subform which is unbound...
Sorry...but your scenario doesn't make sense! An Unbound Form (i.e. a subform which is unbound) doesn't have any Records (it's Unbound) and so can't have a New Record!

An Unbound Form only contains Unbound Controls, for entering data. This data doesn't become a Record until it is committed a Table...and that Record will never be displayed in an Unbound Form.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom