Link to home
Start Free TrialLog in
Avatar of lauriecking0623
lauriecking0623

asked on

Reverse Lookup

I am stuck on this piece of my database.  When I double-click on my datasheet, it will open up the associated form and take the user to the record that they double-clicked on.

So I used this code,

DoCmd.Close
DoCmd.OpenForm "FRM"Requests". WhereCondition:="[REQUEST_ID]=""" & Me.REQUEST_ID & """"

It works great.  What I would like to do is put a button next to the REQUEST_ID on another form like DATA_OBJECTS when the user clicks on the button it will open up the REQUEST_ID form and take the user to that particular record. It won't work.

I get an error when I click on the button stating the following:

Run-time error '2467':
The expression you entered refers to an object that is closed or doesn't exist.

I know it exists. I do not know why my code won't open up the form using this button. It works on my datasheets.

Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lauriecking0623
lauriecking0623

ASKER

This worked great. Thank you. I can do the reverse of the lookup in my database.