• Not a valid bookmark!!! Error msg (Access 2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Not a valid bookmark!!! Error msg (Access 2002)

    Author
    Topic
    #423250

    Hi everybody. Yet again i call on your experience to help me out of a bit of bother. We have written a stock allocation system, but sometimes we get the not a valid bookmark error. Can anybody tell me why this happens and how i can stop it so that it doesnt keep messing up my stock take!!
    thanks v much. bash

    Viewing 2 reply threads
    Author
    Replies
    • #967887

      Since you don’t provide any information about the circumstances in which the error occurs, I can only give a general answer.

      This error usually indicates that one or more records in a table have become corrupt. Try compacting the database (Tools | Database Utilities | compact and Repair Database…).

    • #967894

      thanks hans. here is the code. wonder if this helps

      Sub AutoAllocate_Click()
      DoCmd.RunCommand acCmdSaveRecord
      If PassVars(3) = “0” Then
      MyMsgBox (“Cannot do auto allocation with no specific size”)
      Exit Sub
      End If

      If Forms![consignment sales allocations]![AllowAutoAllocate] = False Then
      MyMsgBox (“Cannot auto allocate this product, not allowed”)
      Exit Sub
      End If

      If Forms![consignment sales allocations]![AllocationOnHold] = True Then
      MyMsgBox (“Sales line allocation on hold”)
      Exit Sub
      End If

      Call CalcAllocationTotals

      If Nz(Tempused, 0) >= Nz(Forms![consignment sales allocations]![Text100], 0) Then
      MyMsgBox (“Fully allocated already”)
      Exit Sub
      End If

      Dim QtyLeftToDo As Double
      QtyLeftToDo = Nz(Forms![consignment sales allocations]![Text100], 0) – Tempused

      Dim QtyTaken As Double

      Set cl = Me.RecordsetClone

      If cl.RecordCount = 0 Then
      MyMsgBox (“Nothing to allocated to”)
      Exit Sub
      End If

      cl.close

      Dim Done As Boolean
      Dim Stopit As Boolean

      Set cl = Me.RecordsetClone
      cl.MoveFirst

      Stopit = False
      While Not Stopit
      If cl!PPStockOnHold = False Then
      If Nz(cl!PPQtyLeft, 0) > 0 Then
      If Nz(cl!TBAmount, 0) = 0 Then
      If Nz(cl!PPQtyLeft, 0) >= QtyLeftToDo Then
      Me.bookmark = cl.bookmark
      Me!TBAmount = QtyLeftToDo
      Call AutoTakeStock
      QtyLeftToDo = 0
      Stopit = True
      Else
      Me.bookmark = cl.bookmark
      Me!TBAmount = cl!PPQtyLeft
      Call AutoTakeStock
      QtyLeftToDo = QtyLeftToDo – cl!PPQtyLeft
      End If
      End If
      End If
      End If
      cl.MoveNext
      If cl.EOF = True Then
      Stopit = True
      End If
      Wend

      Me.Requery
      Me.Refresh
      Call CalcAllocationTotals

      • #967897

        Where in the code does the error occur? Please try to provide specific information.

    • #967919

      Another possible cause of that error is when you try to use a bookmark saved prior to a requery.

    Viewing 2 reply threads
    Reply To: Reply #967919 in Not a valid bookmark!!! Error msg (Access 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel