简体   繁体   中英

Call to Mainform from Subform

I have an access database that has a form with a VBA populated date.

Each time the form loads the date is automatically populated into the textbox labeled "Date". On this same form I have a subform that links to a seperate table for calculation purposes.

I want the same date from that "Date" field to be saved in my subforms calculation table.

Any suggestions?

For your calculation you can reference the date control on the parent form like this ( not tested )

Me.Parent.lblDate

suppose you wanted to calculate 3 days ago

DateAdd("d",-3,Me.Parent.lblDate)

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