Deb-
Replace "YourSubformControl" with the name of the control on your outer form
that contains the subform. It's often the same name as the form inside the
control, but not always. Open your form in Design view, select the subform
control, then open the Properties window and look at the Name property.
John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Deb
Sent: Friday, August 05, 2011 5:31 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Placing button on form to make new record in subform
Hi all,
I need to place a button on my main form to create a new record in my
subform. I found this code online, but cannot get it to work.
1. Private Sub YourButton_Click
2. If Me!YourSubformControl.Form.Dirty Then
3. Me!YourSubformControl.Form.Dirty = False
4. End If
5.
6. Me!YourSubform.SetFocus
7.
8. DoCmd.GoToRecord , , acNewRec
9.
10. End Sub
I'm not sure what the YourSubformControl means?
Thank you,
Deb
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
Kamis, 04 Agustus 2011
RE: [MS_AccessPros] Placing button on form to make new record in subform
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar