Double Click On Form to Open A Detail Form

CharlesWhiteman

Registered User.
Local time
Today, 08:22
Joined
Feb 26, 2007
Messages
421
If i have a query which, for example, displayes company name and date for next call, at the moment it would be a subform with two columns.

How would i make a form which would allow a whole line in the query to be selected and when double clicked then open another form.

So the main question - how to make a form which allows a line entry to be selected for double click.

Thankx all
 
In your form, in design view, any of the fields has the property On_Dbl_Click. then you can use the code builder to enter some VBA to open the other form; like:

Private Sub FieldName_DblClick(Cancel As Integer)
DoCmd.OpenForm "Name of the form you want to open"
DoCmd.Close acform,"The name of the current form"

End Sub

The other form will probaly open on the first record, not on the one you just clicked on so you'll need to either filter the query for the 2nd form based on information from the first or have it FIND the record in the second form based on the value of a field in the first form.

Did that make any sense?:D


Hope that helps

Goh
 
Thanks, I've looked at this and have made it open the form that I wanted to but is doesnt open the form containing the detail of the record. also, I'm changing the SubForm to a list box.
 
You need to have a unique field in common between the 2 set of records. Usually it is an id that appears in both tables. Eg

Table1 Table2
CompanyID CompanyID, ContactID

The link to both set of records CompanyID, allows you to show the contacts details for that particular company.

Dave
 

Users who are viewing this thread

Back
Top Bottom