Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    requery problem (Access 2000)

    I came accross an unexpetced problem with updating a control on my form.The control is called "current", the form Frm1. The control must show the available current quantities.I have a very complicated function in the OnOpen event of the form,which amends the quantiies in the back end database.However these updates are not reflected immediately on the control called "current".I have made many efforts, with all possible uses of the requery method, requering both the form and the control, but i hadno success.
    Yet when i close the form and open it, the quantities are updated.I want to avoit cl osing and opening the form though code.My question is:Is there any other more owerful method besides the requery method that could be used by me?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: requery problem (Access 2000)

    Have you tried putting a command button on the form that triggers a requery of the form?

    I suppose my question is "Are you sure that the requery method has actually happened?" If a command button works it tells you that the problem is not with the method itself. You then need to work out which event to attach it to to make it work properly. Have you tried the oncurrent event?
    Regards
    John



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

    Re: requery problem (Access 2000)

    You didn't say what information was being updated or how. A single record, multiple records? Are you opening a recordset, or perhaps executing an append/update query? (and the situation does seem strange, updating a database just when a form opens.)

    You might try moving this to the Load event (sometimes that helps). YOu might also try putting in a DoEvents after your update/append. Sometimes that helps.

    Plus, I'd like to echo what John said. Are you SURE that the database has really been updated when you think it has?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: requery problem (Access 2000)

    A real dumb question, is the control 'current' a bound control?
    And a further thought, the control called 'current', could Access be objecting to this name?

    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: requery problem (Access 2000)

    Another thought on this.
    If you open the form by clicking a button on a menu, take the complicated function out of the onOpen event and add it to the click event of the button (before the open form command) , so that all data updates are finished before you open the form. then you shouldn't need to requery.
    Regards
    John



Posting Permissions

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