Syntax for sub sub form in macro

  • Thread starter Thread starter TRose
  • Start date Start date
T

TRose

I have a form named Account which includes a sub form named Risk. Risk
includes a sub form named Assertion. Assertion includes a combo box named
AssertionSelect whose data is based upon the record in the Account form.
However, the data in AssertionSelect does not refresh when the record in the
Account form changes. (Note that the names of the sub forms above are the
names of the controls on the higher forms, not the names of the underlying
forms.)

I have found that, after changing the Account record, I can manually refresh
the AssertionSelect data by clicking on the combo box and hitting "F9". I am
trying to write a macro (on the Current event of the Account form) using the
Requery action to do this automatically, but I haven't been able to find the
right syntax combination so that the macro finds the combo box and updates
it. Any suggestions would be greatly appreciated.
 
TRose,

It would possibly be simpler to do the Requery on the Enter event of the
AssertionSelect combobox, rather than theCurrent event of the 1st level
form.

--
Steve Schapel, Microsoft Access MVP


TRose said:
I have a form named Account which includes a sub form named Risk. Risk
includes a sub form named Assertion. Assertion includes a combo box named
AssertionSelect whose data is based upon the record in the Account form.
However, the data in AssertionSelect does not refresh when the record in
the
Account form changes. (Note that the names of the sub forms above are the
names of the controls on the higher forms, not the names of the underlying
forms.)

I have found that, after changing the Account record, I can manually
refresh
the AssertionSelect data by clicking on the combo box and hitting "F9". I
am
trying to write a macro (on the Current event of the Account form) using
the
Requery action to do this automatically, but I haven't been able to find
the
right syntax combination so that the macro finds the combo box and updates
it. Any suggestions would be greatly appreciated.



__________ Information from ESET Smart Security, version of virus signature database 4139 (20090608) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
Steve:

That's a good idea and I'll use it as a backup plan, but I'd prefer that the
combobox refresh when the Account is changed, instead of when the user goes
to the combobox. What happens now (and would still) is that some of the
previously selected assertions don't show up until the list is refreshed.

Is there syntax to refer to a control on a sub sub form from the 1st level
form? Thanks.
 
TRose,

You can't do this with a macro, if the control being requeried is not on the
active object. You will need to use a VBA procedure instead. The syntax
will be:

Me.Risk.Form!Assertion.Form!AssertionSelect.Requery

--
Steve Schapel, Microsoft Access MVP


TRose said:
Steve:

That's a good idea and I'll use it as a backup plan, but I'd prefer that
the
combobox refresh when the Account is changed, instead of when the user
goes
to the combobox. What happens now (and would still) is that some of the
previously selected assertions don't show up until the list is refreshed.

Is there syntax to refer to a control on a sub sub form from the 1st level
form? Thanks.



__________ Information from ESET Smart Security, version of virus signature database 4139 (20090608) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
Steve:

That appears to have worked! Thank you very much as I have tried to fix
this for several weeks and have tried to get help on other boards, but nobody
has said that you can't do it in a macro much less also provided the correct
syntax. You're going to make a lot of people in my office (including me)
happy!
 
Back
Top