Link to home
Start Free TrialLog in
Avatar of lehi52
lehi52

asked on

really need help with click not going to person clicked on, gozreh

I put a double click event so that when you click on a name,  it takes the user to the form on which the name is located.  Now I tried to use that same on in a different place and it is returning an error.  It works elsewhere just not here.  See code and attached database.  

Private Sub Policy_Name_DblClick(Cancel As Integer)
   DoCmd.SearchForRecord acDataForm, "Contact Form", acFirst, "[ContactID] = " & Nz(Me.ContactID, 0)
   Me.Parent.TabCtl0 = 1
End Sub

Open in new window


This code works on the copy of actions and opps subform.  But it does not work on expiring in 7 days subform.  WHen I double click the policy name in the expiring in 7 days subform is throwing an error.  

See the contact form and go to actions tab and you can try it there.
1st.accdb
Avatar of lehi52
lehi52

ASKER

One big difference between the expires in 7 days and the copy of actions and opps subforms is the expires in 7 days is populated based on a query.   How would that change the code.
Avatar of lehi52

ASKER

I think the reason is because the expiring in 7 days subform is pulling data from a query.  So the question is how do I change the code.
Avatar of lehi52

ASKER

Please help.  This is the last thing for a while that I need.
ASKER CERTIFIED SOLUTION
Avatar of Bill Ross
Bill Ross
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

Such a simple resolution.  haha.   You are awesome.   Thanks for your help.
Avatar of lehi52

ASKER

Such a simple resolution.  haha.   You are awesome.   Thanks for your help.