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]
 

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