Current record

andybrst

New Member
Joined
Jan 24, 2003
Messages
45
I have a subform in datasheet format which summarises all the records refering to the value in a combo box.

I would like to be able to 'double click' on a specific record on the subform which would then open the detail form for that particular record.

Can this be done?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I did something similar to this in a Help Desk Ticketing System I created awhile back.. yes, it can be done.

You simply open the form/subform in design view, right click on the field you want the user to double-click on, select properties, click on the Events Tab and then on the OnDblClick event... enter code here.

You need to collect unique info from the selected record and pass that to the detail form in order to open the detail form displaying that records detail.
 
Upvote 0
Adding to MyBoo's response, when I do this I make every field in the original sub-form so it will act on a double-click. To do that without a lot of duplicated code, I write the code once, then have the double-click event of each field call the code I wrote to handle the double-click.
 
Upvote 0
Thanks for the help Boo and Vic. Because I am a novice on Access, can anyone advise me on the code I should be using. Thanks
 
Upvote 0
It's not that simple.

Assumptions:

Your subform contains a unique Identifier for each record displayed... in this case, we'll assume you have a Table1RecID for each record that is your primary key.

Your detail form is based on a table where each record contains a reference to that unique identifier.... we'll call this DetailID... same data in both tables, just named differently (in this example)

On your subform:

This is the MOST basic of examples
In design mode, under Events... create the following code snipet:

docmd.openform "NameofDetailFormGoesHere",,,DetailID = "Forms!NameofDetailForm.Table1RecID"

That's the minimum you need. While in the code snipet, click on HELP, search for OpenForm to get additional information.
 
Upvote 0
On your subform:

This is the MOST basic of examples
In design mode, under Events... create the following code snipet:

Just in case you didn't know... code snipet goes under the On Dbl Click Event.
 
Upvote 0

Forum statistics

Threads
1,226,453
Messages
6,191,137
Members
453,642
Latest member
jefals

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top