Getting RunTime Error

  • Thread starter kryszystof via AccessMonster.com
  • Start date
K

kryszystof via AccessMonster.com

Good Morning,

I am trying to run code in a form, and I am getting error of

Run-Time Error '2501'
The OpenForm action was cancelled.

i have checked syntax, naming, i can't figure it out,

i have this specific function in another access db, and it works great.

any suggestions?

my code:

Private Sub QuickLookup_AfterUpdate()

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_Main"

stLinkCriteria = "[WRKORDNBR]=" & "'" & Me![QuickLookup] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub


TIA,
~K
 
K

Klatuu

The problem is this line:
stLinkCriteria = "[WRKORDNBR]=" & "'" & Me![QuickLookup] & "'"
Change it to this:
stLinkCriteria = "[WRKORDNBR]='" & Me![QuickLookup] & "'"
 

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