Macro to open a Form(from a Subform) (1 Viewer)

itchy

Utterly confused since...
Local time
Today, 06:44
Joined
Jan 25, 2001
Messages
31
I have a subform (on a search form) that is based on a query. What I am trying to do is when the user dbl clicks any record in the subform, another form (the edit form) opens allowing the user to edit the information for that record. I have created a macro to open the form and have filled in the Where clause to view the current selected record and have set the On dbl Click properties of the subform to invoke the macro. This all works fine if I open the subform individually in the database window but it does not work if I open the search form (that contains the subform). I know that there is a way to do this, I just can't remember how! I think that it has something to do with the Where clause in the macro, something about showing the whole path from the subform to the search form...
Does anyone know???
 
R

Rich

Guest
You have to add the main form name ie.Forms!YourMainForm!YourSubform.Form!Field
Open the main form in design view and use the expression builder.
HTH

[This message has been edited by Rich (edited 01-30-2001).]
 

itchy

Utterly confused since...
Local time
Today, 06:44
Joined
Jan 25, 2001
Messages
31
Thats it! Now I remember! I actually just added the main form to the where clause in the macro itself.
[strCompanyName]=[Forms]![frmDataSearch]![frmClientDataSubform]![Company Name]
It works great! Thanks for jogging my memory!
 

Users who are viewing this thread

Top Bottom