button

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

Guest

When creating a button using the wizard to open up a form and find specific
data, how can I link multiple fields to look up matching data?
 
If you look at the code created by the CommandButton Wizard, it uses a
Variable "strLinkCriteria" (or something similar). All you need to do is to
modify this strLinkCriteria to match what you need. For example, if you
need to open the Form at the Record where Field1 = TextBox1 and Field2 =
TextBox2 (assuming both Field1 & Field2 are *numeric* Fields in the
RecordSource of the Form you want to open and TextBox1 and TextBox2 are on
the current Form, you can use:

strLinkCriteria = "[Field1] = " & Me.TextBox1 & _
" AND [Field2] = " & Me.TextBox2
 
Back
Top