• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

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
0
lehi52
Asked:
lehi52
  • 5
1 Solution
 
lehi52Author Commented:
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.
0
 
lehi52Author Commented:
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.
0
 
lehi52Author Commented:
Please help.  This is the last thing for a while that I need.
0
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
Bill RossCommented:
Hi,

Add Contact ID to the Query "exp next week".

Regards,

Bill
0
 
lehi52Author Commented:
Such a simple resolution.  haha.   You are awesome.   Thanks for your help.
0
 
lehi52Author Commented:
Such a simple resolution.  haha.   You are awesome.   Thanks for your help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now