Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    not a valid bookmark (Access 2000)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: not a valid bookmark (Access 2000)

    Where are you setting strBookmark value? If there is no match, you don't need to set a bookmark because the recordset pointer is still on the previous record and the clone pointer is at the EOF. The recordsetclone will be discarded anyhow, so you need do nothing except pop up your message.
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: not a valid bookmark (Access 2000)

    Thank you, Charlotte.It was a good advice and i got rid off the bookmark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •