Invalid Bookmark Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thelma Lubkin

    Invalid Bookmark Error

    With Me!PERSONSLIST. Form.RecordsetC lone
    .FindFirst strID
    If .NoMatch Then
    Debug.Print "key " & Key & " nomatch"
    Exit Sub
    Else
    If Me.Dirty Then Me.Dirty = False
    Debug.Print "A_LOAD bookmark = " & .Bookmark
    Debug.Print "A_LOAD cloneKey = " & .Fields("PrimKe y")
    ' Me.Bookmark = .Bookmark
    End If
    End With

    When I try to use the code above to reset the selected
    record of a form's subform, I get the error "Invalid bookmark"
    when I remove the comment symbol from the line

    Me.Bookmark = .Bookmark

    The debug.print of .Fields("PrimKe y") seems to indicate that the
    sought for record exists and can be correctly read.

    What can I do about this?

    --thelma


  • Wayne Morgan

    #2
    Re: Invalid Bookmark Error

    You are trying to set the parent form's bookmark to the subform's bookmark.
    These are two different recordsets. What exactly are you trying to do?

    --
    Wayne Morgan
    MS Access MVP


    "Thelma Lubkin" <thelma@alpha2. csd.uwm.edu> wrote in message
    news:da55gr$vsm $1@uwm.edu...[color=blue]
    > With Me!PERSONSLIST. Form.RecordsetC lone
    > .FindFirst strID
    > If .NoMatch Then
    > Debug.Print "key " & Key & " nomatch"
    > Exit Sub
    > Else
    > If Me.Dirty Then Me.Dirty = False
    > Debug.Print "A_LOAD bookmark = " & .Bookmark
    > Debug.Print "A_LOAD cloneKey = " & .Fields("PrimKe y")
    > ' Me.Bookmark = .Bookmark
    > End If
    > End With
    >
    > When I try to use the code above to reset the selected
    > record of a form's subform, I get the error "Invalid bookmark"
    > when I remove the comment symbol from the line
    >
    > Me.Bookmark = .Bookmark
    >
    > The debug.print of .Fields("PrimKe y") seems to indicate that the
    > sought for record exists and can be correctly read.
    >
    > What can I do about this?
    >
    > --thelma
    >
    >[/color]


    Comment

    • Thelma Lubkin

      #3
      Re: Invalid Bookmark Error

      Wayne Morgan <comprev_gothro ughthenewsgroup @hotmail.com> wrote:
      : You are trying to set the parent form's bookmark to the subform's bookmark.
      : These are two different recordsets. What exactly are you trying to do?

      I want to reset the subform's bookmark, to change the selected
      record displayed. I changed the code to actually do that and it
      works now. Thank you for helping
      --thelma
      : --
      : Wayne Morgan
      : MS Access MVP


      : "Thelma Lubkin" <thelma@alpha2. csd.uwm.edu> wrote in message
      : news:da55gr$vsm $1@uwm.edu...
      :> With Me!PERSONSLIST. Form.RecordsetC lone
      :> .FindFirst strID
      :> If .NoMatch Then
      :> Debug.Print "key " & Key & " nomatch"
      :> Exit Sub
      :> Else
      :> If Me.Dirty Then Me.Dirty = False
      :> Debug.Print "A_LOAD bookmark = " & .Bookmark
      :> Debug.Print "A_LOAD cloneKey = " & .Fields("PrimKe y")
      :> ' Me.Bookmark = .Bookmark
      :> End If
      :> End With

      Comment

      Working...