Open Form with Criteria

S

Sash

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]
 
M

Marshall Barton

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]
 
Top