Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


double click name open a record

Posted on 2014-02-11
Medium Priority
Last Modified: 2014-02-19
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.
Question by:lehi52
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
LVL 39

Expert Comment

ID: 39851493
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.

or the long form of reference would be

Author Comment

ID: 39851536
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.
LVL 39

Expert Comment

ID: 39851567
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.
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.


Author Comment

ID: 39851732
Ill see if I can figure it out based on what you put.
LVL 10

Expert Comment

ID: 39853307
I added a search when you Double Click the police name.

Author Comment

ID: 39853577
Gozreh,  is there a way to have it change tabs and do the search when you click the name.
LVL 10

Accepted Solution

Gozreh earned 2000 total points
ID: 39853608
yes, add to the code    Me.Parent.TabCtl0 = 1
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


Author Closing Comment

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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question