Linking to a form from a combo box search

  • Thread starter Thread starter adrian007uk
  • Start date Start date
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?
 
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.
 
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?
 
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
 
Hi Steve

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

Adrian
 
Back
Top