Results 1 to 2 of 2
  1. #1
    Join Date
    May 2007
    Posts
    37

    Unanswered: Bookmark problem

    I'm using the following to bring a person details using a Barcode .
    It works fine.
    But if I'm using the same barcode again on the already found person,
    for some reason it brings me a person that is not related to this barcode.
    In the third attempt it will bring me the right person... and so on.


    Private Sub Barcode_AfterUpdate()
    Dim rst As DAO.Recordset
    Dim strCriteria As String
    strCriteria = "[Bar_Code] = " & Me.Barcode
    Set rst = Me.RecordsetClone
    rst.FindFirst strCriteria
    If rst.NoMatch Then
    MsgBox "No entry found.", vbInformation
    Else
    Me.Bookmark = rst.Bookmark
    End If
    Set rst = Nothing
    End Sub

    am I missing something?

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Not sure whether this will work but you may add the following line immediately after the Set rst = Me.RecordsetClone statement and try as shown below:

    Code:
    Set rst = Me.RecordsetClone
    rst.MoveFirst
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

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