Using a list in one form to define the content of another

jamesloker

New member
Local time
Today, 01:03
Joined
Mar 5, 2014
Messages
1
Hello

I'm going to try and explain this as best I can.

I am building a database to track contacts and interactions with them. When the user marks that they need to follow up a phone call, the contact's name appears in a list on the dashboard (an initial form) of the user to remind them to call.

I want to make it so that when you double click on any of the contacts in this list - the form that stores all of their information opens at that record. I'm guessing there are a few ways to do this. I first attempted it by building a query that matched the ID to be shown in the new form with the ID in the list on the old form but this is not ideal.

Is there any way to do this? I think it might be possible by building an expression but all of my efforts so far have not worked. I've tried something like this:

[Forms]![HH Dashboard]![List41]=[Forms]![Test Form]![ID]

The test form is the form that will contain all of the details about the client.

Hopefully someone can show me where I'm going wrong.

Thanks in advance!

James
 
Generally this is a fairly simple thing to achieve. However, in this case it is hard to say how to do it without more details.

Where is the list coming from? How is it getting the data? Is the listbox based on a query and, if so, is the ID field being stored in a query on which the listbox is based?

If so, it should be possible to do this with a little VBA doing something like this in the DoubleClick event of your list box:

Code:
    Dim stdocname As String
    Dim stLinkCriteria As String

    stdocname = "TestForm"
    
    stLinkCriteria = "[ID]=" & Me![ListBox41]
    DoCmd.OpenForm stdocname, , , stLinkCriteria
    
    DoCmd.Close acForm, "HHDashboard"

End Sub
 

Users who are viewing this thread

Back
Top Bottom