Linking to a form from a combo box search

A

adrian007uk

Thanks to this forum i have now managed to sort out my form. The form lists
basic details of 'records' associated with the selected 'artist' from the
combo box. Is it possible to select a 'record' that is displayed and open
the form assocaited with that record?
 
A

Arvin Meyer [MVP]

Sure, assuming that the record's key (ID field) is in the record, you can
use the record itself by clicking on the recordselector, or just place a
command button on the form (here's some air code):

Private cmdOpen_Click()
DoCmd.OpenForm "YourFormName", , ,"RecordID =" & Me.txtRecordID
End Sub

RecordID is the name of the field in the table, and txtRecordID is the name
of the textbox in the current form.
 
A

adrian007uk

Hi Arvin

That code worked exactly as i wanted. Many thanks. You don't happen to
have any code that preforms exactly the same function if i was to 'double
click' a record do you?
 
S

Steve

Just put the same line of code into On Dbl Click event for the control that
will be double clicked. You can get to this from the Event tab of the control
properties dialog box.

Steve
 
A

adrian007uk

Hi Steve

Thanks for the advice. I put the same code in the double click event of the
'Forms' event and it worked.

Adrian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top