Results 1 to 10 of 10
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: bookmark not working

    I want the record found in the subform to be the current record. I have object variable(rst) points to the form’s recordset. I use the bookmark property on the rst after the record is found but the pointer does not move to the found record (it looks like is pointing to the first record on the form). It should work but doesn’t. I can’t figure it out. Please help

    Dim rst As New ADODB.Recordset
    ‘next_work_ord_num passed in from the code right before this section
    ‘rs_old_sample_work_ords(1).Value same

    Set rst = Forms!edit_shipping_sched!shipping_sched_list_subf orm.Form.Recordsetclone
    rst.MoveFirst

    Do While Not rst.EOF

    Forms!edit_shipping_sched!shipping_sched_list_subf orm.SetFocus
    Forms!edit_shipping_sched!shipping_sched_list_subf orm.Form.work_ord_num.SetFocus

    If next_work_ord_num = rst(1).Value Then
    If rst(2).Value = rs_old_sample_work_ords(1).Value Then Forms!edit_shipping_sched!shipping_sched_list_subf orm.Form.Bookmark = rst.bookmark
    Exit Do
    End If
    Else

    rst.MoveNext
    End If
    Loop


    thanks!

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Alice:
    I have the same problem and read all about Bookmark, the conclusion for me is don't work in a subform only work in a form.
    Saludos
    Norberto

  3. #3
    Join Date
    May 2002
    Posts
    395

    move to a record in subform

    Originally posted by Norberto
    Alice:
    I have the same problem and read all about Bookmark, the conclusion for me is don't work in a subform only work in a form.
    Thank you so much. That explains why it does not work. I look thru the books and search on-line it never said you can't use on subforms. Do you know how I can move the pointer go to a specific record in the subform in vb? In other words make a select record as the current record in the subform.

    Thanks!

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: move to a record in subform

    Originally posted by alicejwz
    Thank you so much. That explains why it does not work. I look thru the books and search on-line it never said you can't use on subforms. Do you know how I can move the pointer go to a specific record in the subform in vb? In other words make a select record as the current record in the subform.

    Thanks!
    Maybe the sentence DoCmd.GoToRecord can help you this one work in the subform.
    Saludos
    Norberto

  5. #5
    Join Date
    May 2002
    Posts
    395

    Re: move to a record in subform

    Originally posted by Norberto
    Maybe the sentence DoCmd.GoToRecord can help you this one work in the subform.
    I have been trying to use GoToREcord to display the record found in the subform but the record number/location of the found record is not true location. The subform doesn't move to the found record.
    rst is object variable pointing to subform's recordset
    sub xyz

    Dim strmark As String
    Dim next_work_ord_num As String
    strmark = ""
    formname = "shipping_sched_list"

    DoCmd.OpenForm formname, acFormDS

    Set f = Forms(formname)
    Set rst = f.RecordsetClone

    next_work_ord_num = "330582-00"
    rst.MoveFirst

    strmark = rst.Bookmark
    DoCmd.GoToRecord acDataForm, "shipping_sched_list", acGoTo, strmark
    Exit Sub

    Thanks!

  6. #6
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Alice:
    Bookmark is not a record number don't work in acGoTo
    Saludos
    Norberto

  7. #7
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Originally posted by Norberto
    Alice:
    Bookmark is not a record number don't work in acGoTo
    Alice:
    I don't now if you found a solution for your problem.
    If you want found and especial record in the subform and make that like
    the active record, i have some tool for that.
    I must do that when i have the same problem.
    If you need this i prepare the step for do it an send to you....
    Saludos
    Norberto

  8. #8
    Join Date
    May 2002
    Posts
    395

    pause the screen until the record is found

    Originally posted by Norberto
    Alice:
    I don't now if you found a solution for your problem.
    If you want found and especial record in the subform and make that like
    the active record, i have some tool for that.
    I must do that when i have the same problem.
    If you need this i prepare the step for do it an send to you....
    Hello,

    Thanks for asking and your help. It was not working still 20 minutes when I was about to email you.

    I took out the docmd.gotorecord statement and it point to found record in the subform. I remove the docmd.openform so it doesn't open up the subform, changed recordsetclone to recordset in rst object variable, getting the correct syntax for subform and set form obj pointing to it. The only thing is the screen keep scrolling while it searching how can I get the screen to pause and then just display to the record.

    Thanks!

  9. #9
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: pause the screen until the record is found

    Originally posted by alicejwz
    Hello,

    Thanks for asking and your help. It was not working still 20 minutes when I was about to email you.

    I took out the docmd.gotorecord statement and it point to found record in the subform. I remove the docmd.openform so it doesn't open up the subform, changed recordsetclone to recordset in rst object variable, getting the correct syntax for subform and set form obj pointing to it. The only thing is the screen keep scrolling while it searching how can I get the screen to pause and then just display to the record.

    Thanks!
    I need see how the program work.
    If you want send a zip sample base in Access 97 format then i can see
    all and tell my opinion.
    Saludos
    Norberto

  10. #10
    Join Date
    May 2002
    Posts
    395

    Re: pause the screen until the record is found

    Originally posted by Norberto
    I need see how the program work.
    If you want send a zip sample base in Access 97 format then i can see
    all and tell my opinion.
    Yes !! it is working now. I receive a sample code from the Joe and it's working. Thank you for lending a hand. Have a great day!

Posting Permissions

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