Form ID selection comes up in other form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I select a record in a form, let's say on a list box, I want another form
to popup with that same record (referencing to ID). I want the second form
to open up and view that record by ID. These forms each have referential
integrity, but for designing reasons I don't want to create a subform within
the original form. Anyway I can do this?
 
Assuming the listbox on the first form is named List0, and you want to
open form Form1, in whose recordsource you want Field1 to match the
value selected in List0:

DoCmd.OpenForm "Form1",,,"Field1 = '" & Me.List0 & "'"

if Field1 is text, or:

DoCmd.OpenForm "Form1",,,"Field1 = " & Me.List0

if Field1 is numeric.

HTH,
Nikos
 

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

Back
Top