Can't find the form message after opening the form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a search form that is based on a query, and after I place the search
criteria in the search form access opens the form, then when I close the form
it gives me the following message: Microsoft Access Can't find the
'FRM_Search_Criteria' referred to in a macro expression or Visual Basic Code.
It has already opened the form and this happens when I close the form and
return to the search form, which I have named FRM_Search.
 
Put a button on FRM_Search_Criteria and put this code in the Click event:
Me.Visible = False

Put the following code in the Click event of the button you use to start the
search:
DoCmd.OpenForm "FRM_Search_Criteria",,,,,acDialog
DoCmd.OpenForm "Frm_Search"
DoCmd.Close acForm, "FRM_Search_Criteria"
 
Hi Leslie, if you set a breakpoint on the close event for FRM_Search_Criteria
and step through the code, you probably are referencing that form after the
form has already closed. Since it isn't open, the error is generated.

Have you tried that yet?

Lance
 

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

Back
Top