Results 1 to 5 of 5

Thread: Form Requery

  1. #1
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100

    Unanswered: Form Requery

    I'm having problems with requerying forms, I have a form that opens up a few pop-up forms that change info. the pop-up forms have code to requery the main form when they close. It normally works fine but sometimes it does not work at all and it's driving me nuts.

    has anyone got any ideas?

    thanks

  2. #2
    Join Date
    Dec 2001
    Posts
    79
    Have you thought about just requering your main form from the OnActivate event procedure?

    If this doesn't help, please post some of the code you are using to do the requery.
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

  3. #3
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    I looked up the help with regards to the Onactivate event but it states that it will not work if the form receives focus from a pop up form which is what I'm doing.

    The code I'm using is very simple:

    (it's placed in the onclose event of the pop up form)

    [Forms]![FRM_Planning].requery


    the database is split front/backend it appears that when I modify the backend database it sometimes causes the requery not to function properly. I always refresh the table links and compact and repair the frontend database after any modifications.

    It's still driving me mad, am I missing out something simple?

  4. #4
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    Maybe you're requerying the form before the record is actually saved. If yo change data through the popup form, include
    DoCmd.RunCommand acCmdSaveRecord
    before requery.

    Is your popup form opened from the FRM_Planning form? And if yes, is it opened as dialog?
    In this case, the requery could be done from FRM_Planning form, after the DoCmd.OpenForm ... whatever.

    Good luck

    Dan

  5. #5
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    Thanks Dan, I'll use the save record code as you suggested.

    I'm never sure as to exactly what order events occur so your idea sounds bullet proof.

Posting Permissions

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