Results 1 to 5 of 5

Thread: using bookmark?

  1. #1
    Join Date
    May 2003
    Posts
    25

    Unanswered: using bookmark?

    hello,

    here is what i am trying to do. i have a form showing one user record at a time. part of this user record relates it to another user. i would like to be able to click a button and go to the record that is related. i thought maybe i could use bookmark to do this? here is the code i am putting in my onclick event:

    ownerCode = DSSsub!FacilityID
    Set Urecord = mainfrm.RecordsetClone
    Urecord.FindFirst ("user_ownerCode = '" & ownerCode & "'")
    mainfrm.Bookmark = Urecord.Bookmark

    but it is just taking me to the very first record. what is the right way to do this?

    thanks.

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    findfirst will find the first record in the clone based on the underlying table/query which may may have a different sort order than the form does. remember it is the first record dao.ado finds meeting the criteria you specify

  3. #3
    Join Date
    May 2003
    Posts
    25
    thank you. when i tried it again later, it was actually working, because there is only one record that will apply in any case. however the code only worked when i exited out of the form and then tried again. i am guessing this means i need to requery first or something... can someone tell me how to do that?

    thanks!

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    me.requery will requery teh underlying recordset for the object
    me.refresh will update changed records on the form
    me.repaint will recalculate controls on the form

    if you want to requery a combobox:
    me!comboboxName.requery

  5. #5
    Join Date
    May 2003
    Posts
    25
    thanks again for your help... it's working!

Posting Permissions

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