hi, i have this problem with OpenForm and the stLinkCriteria. I have the following code:
When i debug, the stLinkCriteria contains (for example) :
"[ALAHistorie]![Barcode]= 12345 And [ALAHistorie]![Teller]= 2"
Barcode and Teller (autonumberd counter) are numeric and the record does exist. But i keep getting error 2501, action openform cancelled. With only Barcode as criteria in stLinkCriteria the action succeeds but (logically) only with the first record with that Barcode.
What am i doing wrong with the criteria for that seems to be the problem?
Tanx,
Mark
Code:
[I]Private Sub Knop22_Click()
On Error GoTo Err_Knop22_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ALAHistorieEdit"
stLinkCriteria = "[ALAHistorie]![Barcode]= " & Me![Barcode] & " And _
[ALAHistorie]![Teller]= " & Me![Teller]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Knop22_Click:
Exit Sub
Err_Knop22_Click:
MsgBox Err.Description
MsgBox Err.Number
Resume Exit_Knop22_Click
End Sub[/I]
"[ALAHistorie]![Barcode]= 12345 And [ALAHistorie]![Teller]= 2"
Barcode and Teller (autonumberd counter) are numeric and the record does exist. But i keep getting error 2501, action openform cancelled. With only Barcode as criteria in stLinkCriteria the action succeeds but (logically) only with the first record with that Barcode.
What am i doing wrong with the criteria for that seems to be the problem?
Tanx,
Mark
Comment