Open form on current record

G

Guest

Hello again everyone. I could not find exactly what I needed on previous
posts. I have a command button on a form to open a second form based on
another table. The tables are linked in a one-to-one relationship. How do I
get the button to open the new form to the current record displayed on the
first form?

Thank you
Greg Snidow
 
G

Guest

Use the where condition on the on open command line, that way you can open
the second form from few places (forms)

' If the field Number
Docmd.OpenForm "FormName" ,,,"[FieldnameInTable] = " & Me.[FieldNameInForm]

' If the field String
Docmd.OpenForm "FormName" ,,,"[FieldnameInTable] = '" & Me.[FieldNameInForm]
& "'"
 
G

Guest

Use the text box information from the first form as criteria for the query
that is record source for the second form. Use this --
[Forms]![YourFirstForm]![YourTextBox]
 

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