By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,483 Members | 1,725 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,483 IT Pros & Developers. It's quick & easy.

Subform Update on Load/Open of Parent form

P: 17
Hi guys,

I have a parent form that displays the subform.
The subform query has a link back to the original ID.
I was having issues keepign them in sync, since every parent may not need a subform. So i am trying to create an entry in the subtable whenever the parent is opened. This way it is always in sync and has it ready. VBA is not recognizing the field i want to upodate (tbldashlink) and i get a compile error each time.

Also one more question, since i am using the parent form to execute, does the code go on the parent or subform?

Private Sub Form_AfterUpdate()
Me.tbldashlink.Value = Me.ID
End Sub
Jan 30 '08 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi guys,

I have a parent form that displays the subform.
The subform query has a link back to the original ID.
I was having issues keepign them in sync, since every parent may not need a subform. So i am trying to create an entry in the subtable whenever the parent is opened. This way it is always in sync and has it ready. VBA is not recognizing the field i want to upodate (tbldashlink) and i get a compile error each time.

Also one more question, since i am using the parent form to execute, does the code go on the parent or subform?

Private Sub Form_AfterUpdate()
Me.tbldashlink.Value = Me.ID
End Sub
This is not done by VBA. If you have set up your table structures and referential integrity properly this should happen automatically. Have a look at this tutorial.

Database Normalization and Table structures
Feb 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.