Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    conditional requery (A97 SR2) (Access 97 (SR 2))

    I have a form consisting of the summary lines of the data(it's based on a query), with a grand total at the bottom. My not-so-user-friendly end users want this to happen:

    1. If they are looking at an existing record (lets call this mickey 27) and click the button that opens a form showing the detail of mickey27, they want to be back where they were before on the summary form after the detail form is closed. They also want the grand totals to reflect any changes they made to mickey27.

    2. if they add a new record (mickey29), which opens another form, they want to be able to see the impact adding mickey29 on the grand total.

    If I requery, I can update the totals and put mickey29 into the summary, but this doesn't help when going to mickey27 detail and then back to the summary - it bounces back up to mickey1 because, after all, I am requerying the query.

    Any suggestions?
    <img src=/S/help.gif border=0 alt=help width=23 height=15>
    Carpy Diem, it&#39;s .

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: conditional requery (A97 SR2) (Access 97 (SR 2))

    Prior to executing the requery, you must save the unique ID of the current line ("mickey 27"?). Immediately after the requery, you reposition yourself. The code would be something like this (assumes you unique ID is a text field):

    saveID= UniqueID
    me.requery
    me.recordsetclone.findfirst "UniqueID=" & chr(34) & saveID & chr(34)
    me.bookmark = me.recordsetclone.bookmark
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: conditional requery (A97 SR2) (Access 97 (SR 2))

    Thanks Mark! I know that the bookmark has been discussed before here, but I guess I was pretty clueless <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> yesterday so I appreciate you taking the time to answer me.

    I got it to work on my test database so can't wait to put it into production! <img src=/S/joy.gif border=0 alt=joy width=23 height=23>
    Carpy Diem, it&#39;s .

Posting Permissions

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