Results 1 to 5 of 5

Thread: Requerying Form

  1. #1
    Join Date
    Nov 2003
    Posts
    21

    Unanswered: Requerying Form

    Hello,

    I'm somewhat new to Access, but have developed a runtime application (data entry form) to put on multiple computers in my plant. These are there to enter repair information. I needed my forms on all the computers to update everytime a record was entered. Hence, I was told to REQUERY with the ON TIMER event and to save on an event, which I did. However, when the requery takes place, one of my folks might be right in the middle of entering data into a new record, and the requery takes them back to the first record. First question...is there any better way for the forms to be updated with new data. Second, if not, when I requery, can I have it so it leaves me in the record and field I'm working with? Thanks much,

    Aaron

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Forget Requery. that is not the time and place to use it. Try this instead:

    Code:
    Docmd.Runcommand acCmdSaveRecord
    I don't think using the 'OnTimer' event is a good idea either, but...because I don't have your application in front of me I can't really say one way or the other.

  3. #3
    Join Date
    Nov 2003
    Posts
    21
    Thank you for the quick reply. So, with this code, at what point does the form get updated with the new data in the table from "other" peoples' entered data? I hate to ask this, but where do I insert that code?

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    I see...forget all that above. Try using:

    Me.Refresh in the form's 'OnActivate' event. Like so:

    Code:
    Private Sub Form_Activate()
       Me.Refresh
    End Sub
    Now reset your databse Refresh Interval rate to something less than the default 60 seconds. Perhaps 5 seconds. You can find this by going to the Tools menu, select Options then click on the Advanced tab. The property is called:

    Refresh Interval (sec)

    Try playing with the various update and refresh rates.

  5. #5
    Join Date
    Nov 2003
    Posts
    21
    Well, I tried that, and it still didn't work. I'm not sure why, because it seems that the refresh should be refreshing the forms...kind of like a requery? Here is how I'm testing it. I build my form on my machine and then package the form for runtime. I then go to 2 "side by side" computers and open the new runtime. If I add records in one computer, I'm expecting the form on the other computer to get updated by the refresh, but nothing is happening. If I close down and reopen, the records are updated on the other computer...but obviously that isn't what I want to do. Any other thoughts? Sure appreciate the help.

    Thanks,
    Aaron

Posting Permissions

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