Select record from a list

  • Thread starter Thread starter Andrea
  • Start date Start date
A

Andrea

Is there a way that I can select a record from a list of
records and then go directly to a form view (that I have
created) of that record?
 
Hi Andrea

You can use the following code. Of course you will have to change the form
name as well as the ID of the record.

DoCmd.OpenForm "frmDetails", _
WhereCondition:="RecordID=" & Me.RecordID


Best regards
Maurice St-Cyr

Micro Systems Consultants, Inc
 
Sure. You can create a form with a listbox of your records. Keep the
primary key in the first column. Then from the OnDblClick event
procedure of that form, open your form view that you've created and
specify the primary key of your selected column in the .OpenForm
method "where" clause.

DoCmd.OpenForm "MyFormName", , , "MyKeyField = " &
MyListboxForm!MyListboxControl.column(0)

We have a product called "Selector" that will handle all of this for
you. A shareware/demo is available from
http://www.peterssoftware.com/sel.htm

Hope this helps,

Peter De Baets
Peter's Software - MS Access Tools for Developers
http://www.peterssoftware.com
 
Back
Top