Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill subform with data from last record in table

Status
Not open for further replies.

TechnoMom

Technical User
Apr 29, 2004
17
US
I need help. This somewhat complicated but I'll try to be concise. I have a form for entering a new group reservation. If it a new group and public school, a combo box allows the user to pick the school from a linked table. Once picked, a confirmation box appears to let the user confirm the school address information. The user clicks button which appends this school to the [Group Table] where the [GroupID] is an autonumber field. I then need to populate the [Reservation Form]![Group Table subform] with this last record added to the Group Table. I've tried lots of thing in via Macros but I'm not having luck. The Group Table does get successfully appended but I have not been able to populate the reservation subform.

I'm sure there's a simple solution. Can anyone help me??
 
Is your subform linked to the main form ?
Take a look at the LinkMasterFields and LinkchildFields properties of the subform.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes, the forms are linked using the GroupID. I am opening the reservation form in Add mode and would like to set the GroupID of this record equal to this school record which has just been added to the Group Table.

Thanks!
 
Hello,

In the On Click event of your button that adds the record enter the following code after the update is performed.

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Aaron
 
Aaron -
I will try this. I'm am more of a novice than I realized and I am trying to learn more code. Can you explain what this commmand does.
Thanks,
Robin
 
I'm am more of a novice
First, check the relationships.
Then create your subform with the wizard.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top