Open Form with Criteria

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

Guest

I've done this time and time again, but it's not working in the following
case. Anyone see anything that I could be doing wrong?

Dim stDocName as String
stDocName = "Statement"
DoCmd.OpenForm stDocName, , , "Forms!frmStatement![fldAcct]=" & Me![Text1]
 
Sash said:
I've done this time and time again, but it's not working in the following
case. Anyone see anything that I could be doing wrong?

Dim stDocName as String
stDocName = "Statement"
DoCmd.OpenForm stDocName, , , "Forms!frmStatement![fldAcct]=" & Me![Text1]


You have to use the name of a field in the form's
RecordSource table/query, not a control on the form:

DoCmd.OpenForm stDocName, , , "fldAcct=" & Me![Text1]
 
Back
Top