Access Form/Subform Macro not working

W

Wayne

Using Access 2003 - I have a form with a sub-form. I have a macro with
setvalue to set a field in sub-form with the current date with a double click.

When running the macro I get an error "Access can't find the form "Account
Recon" referred to in a macro expression or visual basic code". The form you
referenced may be closed or may not exist in the database."

The macro works in sub-form only or if I move it to the form it works, just
not in the form/sub-form mode.
Manual updates to the sub-form work fine.
 
N

nomadk

I think you need to reference both the subform and the form it resides on.
Something like "Forms![YourForm]![YourSubform].Form![AccountRecon]".

To get the proper synatx in the future you can:

1. Open the form that holds the subform you'll be referencing.
2. In the Macro window on the SetValue line click the build button next to
the Item field. Navigate to Forms/Loaded Forms, find your form and
doubleclick to find your subform. Now when you select the field the entire
reference will be copied.
 

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