Open Form from query result?

S

Sei

Is it possible to add and event from query to open a form? Similar to adding
event on a control in a form to open another form. Is this possible from
query?

I have a form that searches for records and opens a query with matching
records. Now, I would like to be able to double click on a record and it
would open a form for that record.

THank you,
 
F

fredg

Is it possible to add and event from query to open a form? Similar to adding
event on a control in a form to open another form. Is this possible from
query?

I have a form that searches for records and opens a query with matching
records. Now, I would like to be able to double click on a record and it
would open a form for that record.

THank you,

No... queries don't have that capability.

Create a form to display the query results (make the query the record
source of the form).
Have the search form open this form (not the query).
Then you can code the form to open another form filtered to show the
selected record.
DoCmd.OpenForm "FormName", , , "[RecordID] = " & Me.[RecordID]

The above assumes the record's prime key field is a Number datatype.
If it is a Text datatype, then use
"[RecordID] = """ & Me.[RecordID] & """"
 

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