P
peljo via AccessMonster.com
I have a function that finds a customer.When the customer does not exist, i
get the error not a valid bookmark.
Can you help me with my function ? Is there something wrong with it ? Can i
improve it and make it more stable ?
Public Function FindCustomer()
Dim f As Form
Set f = Forms!FCustomers
Dim strCustomerID As String
Dim strBookmark As String
strCustomerID = InputBox("Enter customer number ? ")
If strCustomerID = "" Then
Exit Function
End If
f.RecordsetClone.FindFirst "CustomerID = " & strCustomerID
If f.RecordsetClone.NoMatch Then
MsgBox "customer " & strCustomerID & " does not exist!!"
f.Bookmark = strBookmark
Else
f.Bookmark = f.RecordsetClone.Bookmark
End If
End Function
get the error not a valid bookmark.
Can you help me with my function ? Is there something wrong with it ? Can i
improve it and make it more stable ?
Public Function FindCustomer()
Dim f As Form
Set f = Forms!FCustomers
Dim strCustomerID As String
Dim strBookmark As String
strCustomerID = InputBox("Enter customer number ? ")
If strCustomerID = "" Then
Exit Function
End If
f.RecordsetClone.FindFirst "CustomerID = " & strCustomerID
If f.RecordsetClone.NoMatch Then
MsgBox "customer " & strCustomerID & " does not exist!!"
f.Bookmark = strBookmark
Else
f.Bookmark = f.RecordsetClone.Bookmark
End If
End Function