Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a form with stLinkCriteria

Status
Not open for further replies.

norine

Technical User
May 29, 2007
2
CA
I have the following code ... I think it's ok but I'm getting an error: Runtime Error '2501' - The OpenForm action was cancelled.


stDocName = "frm_compare"
stLinkCriteria = "[PD_ID] = '" & Me![PD_ID] & "' And [STREET_ID] = '" & Me![STREET_ID] & "'"


DoCmd.OpenForm stDocName, , , stLinkCriteria




End Sub
 
Are your fields numeric?

[tt]stLinkCriteria = "[PD_ID] = " & Me![PD_ID] & " And [STREET_ID] = " & Me![STREET_ID][/tt]
 
That's probably the problem: you don't need delimiters with numeric fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top