Select record from a list

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?
 
S

StCyrM

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
 
P

Peter De Baets

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
 

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