473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Subform Update on Load/Open of Parent form

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
1 2651
MMcCarthy
14,534 Expert Mod 8TB
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

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

Similar topics

3
by: DD | last post by:
I want to link a form to another form by a Cmd Button. CustomerID = CustomerID I want the form to open from the Cmd Button as if it was acting in the same way as subform What would be the code?...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
1
by: BartonConstruction | last post by:
Greetings all, I have a main form (frmClients) with two subforms (subVisits) (subAccount). I got the subforms to reflect what the main form is showing by linking master and child fields (I...
5
by: Swinky | last post by:
I have a form "AccountInfo" that contains company names. I have inserted a subform "Contacts" with contact names and have established parent/child relationships between the two forms. All works...
4
by: Ryan | last post by:
I've got a little bit of code that runs when you enter data in a datasheet view (which is a subform of the form you are in) if rst!DateReceived >= 30 Then Forms!DisposalRecords.Label90.Caption =...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
4
by: Robert | last post by:
Hello. I have a form with 2 subforms on it, subform1 and subform2. Is there some way to requery subform2 from an after update event on one of the fields on subform1? What would the syntax of...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.