Forms: Requery a subform from another form

fmm

Registered User.
Local time
Today, 16:39
Joined
Mar 15, 2001
Messages
76
I need to requery a subform from a third form and can't seem to get it to work.

frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my validation work is done and the new record is added.

However, the new address is not being displayed in the subform.

If I use the command
Forms![frmTest]![frmAddress].Requery
it works fine.

The problem is that I want to be able to frmAddress on any form, and need to pass the name of the main form (in this case frmForm1) as a variable.

If lsTemp = "frmForm1", the statement
Forms![lsTemp]![frmAddress].Requery (and every variation using brackets and quotes that I can think of) fails.

Any ideas?

Thanks!
 
At the moment that would be difficult. It's linked to an SQL database. I could create a stand-alone version, but I have to strip out some identifying data and build the tables, and I'm leaving for the day in 15 minutes.

If I haven't cracked this by late AM tomorrow I'll post a copy.
 
This works:

Forms(lsTemp)!frmAddress.Form.Requery
 

Users who are viewing this thread

Back
Top Bottom