Macros work on form but not on it as subform

S

SFC Traver

I have a form that automatically calculates the scores for the Army PT test.
It works great as a stand alone form. But when I drag it to be a subform in
my main form, I get an error that says it can't find the form (which is now a
subform).
Below is a taste of the macro I'm using. What am I doing wrong?

Condition=[Forms]![APFT_WEIGHT]![AGE] Between 17 And 21
Action=SetValue
Item=[Forms]![APFT_WEIGHT]![APFT PU SCORE]
Expression==DLookUp("[FPU]![17Y]","[FPU]","
[FPU]![REPS]=Forms![APFT_WEIGHT]![APFT RAW PU]")

The scores returned get stored in a tblAPFT. Any help would be appreciated!
Dan
 
J

Jeff Boyce

For the macro to find the information, you'll have to use an expression that
leads it through the main form (in which your subform is embedded), through
the subform control on the main form, and into the subform.

Try Access HELP on "expressions" and "subform" for some ideas on the syntax.
The basic notion is something like:

Forms!YourMainForm!YourSubformControl.Form!YourControlOnTheSubform

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top