Link to home
Start Free TrialLog in
Avatar of lehi52
lehi52

asked on

double click name open a record

I have a list of leads on Lead List tab on the Contact form.  I need to be able to click the row and bring up the record on the General tab.
1.accdb
Avatar of PatHartman
PatHartman
Flag of United States of America image

I can't download your database at the moment so I may be off target.

Assuming the the two forms are actually subforms on another form, change the RecordSource query of the form you want to control so that it references a control in the driving form.

Select ...
From ...
Where somefield = Forms!yourmainform!sfrm1.Form!keyField;

Then in the click event, requery the subform.
Me.Parent!sfrm1.Form.Requery

or the long form of reference would be
Forms!yorumainform!sfrm1.Form.Requery
Avatar of lehi52
lehi52

ASKER

There is a subform called contact form1 with a list of names.  WHen you click a name it needs to load the record on a different tab.   I attached the database but zipped up. I am a beginner so the more simple you can make it the better.
2.accdb
I can't load your database.  I am not in my office.  Can you try to modify the query to reference the form field that contains the foreign key you need to reference?  You only need the one line of code (the requery) in the click event to make this work.
Avatar of lehi52

ASKER

Ill see if I can figure it out based on what you put.
I added a search when you Double Click the police name.
3.accdb
Avatar of lehi52

ASKER

Gozreh,  is there a way to have it change tabs and do the search when you click the name.
ASKER CERTIFIED SOLUTION
Avatar of Gozreh
Gozreh
Flag of United States of America 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 lehi52

ASKER

Gozreh, as usual.   Your help is immense.  I added the code and it works great.