linking form to record

J

John

I have 1 table: tbl_main
primary key is a field called JobNo

1 query: qry_main (this simply has all fields and just places the JobNo
field in ascending order).

I have 2 forms
frm_main
frm_bldInfo

I have created the main form where by the user simply presses a macro button
to open up the frm_bldInfo.
But when the frm_bldInfo opens, it does not open with the relevant
information for the record selected in the main form. The frm_bldInfo simply
shows the first record info in the database and not the relevant record
chosen initially in the main form.
Both the forms have their source as the qry_main.

Should I create a second table that has the bldinfo on its own then simply
create a query linking the two tables with the JobNo field ?
thanks for any help.
 
J

Joan Wild

John said:
I have created the main form where by the user simply presses a macro
button to open up the frm_bldInfo.

If you are using a macro, edit the macro Open Form action. In the lower
pane in the Where cell put
[JobNo]=[Forms]![frm_main]![JobNo]

If you were using event procedure you would modify the code to include the
where clause

DoCmd.OpenForm "frm_bldInfo", , , [JobNo]=" & Me![JobNo]
 

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