简体   繁体   中英

ms access — Create new page tab with a subform and populate subform with data

What I would like to be able to do is when my EditInfo form is loaded, I want to is load the entire client info onto pages.

I want to be able to create a new tab on my TabCtrlEdit tabcontrol on the edit form, add a subform to the new tab and auto populate the subform with data stored in tables.

But I'm a little unsure how to go about this.

Thank you!

EDIT--- A little more info. Each time the client comes they get a new record stored in my visits table. What I would like to do is when the user goes to edit a clients information - It will loop through and give each visit a new tab with the visit subform populated with that visits data. There could be a varying number of these visits so I would like it to be done when the form loads. Right now the EditInfo form just loads the initial visit information (name, ID etc...) but not the rest of the visits as it is stored in a different table.

Here is the solution I have implemented thanks to everyone help!

From my main form I load the edit form using this:

DoCmd.OpenForm "frmEdit", acNormal, , "ID='" & txtID.Value & "'", acFormEdit, acWindowNormal

I've got the ID linked to all tables corresponding to my subforms. (Via relationships). And I just set the all the forms on the edit form to "Continuous".

Thanks again to everyone for their help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM