473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Automatically Requery

102 64KB
MS Access 2010/VBA

The users of the attached query want a third button added that when pushed will cause the query to re-query itself automatically every 3 minutes. How can I do this? Thanks in advance.
Attached Files
File Type: doc Doc1.doc (37.5 KB, 324 views)
Dec 16 '14 #1

✓ answered by jforbes

Put the requery code into the Form_Timer event. Then in the new Button's click event, set the Forms timer interval to 3000. ...3000 because the Form Timer uses milliseconds.

I use the following for a Checkbox to toggle a timer off and on:
Expand|Select|Wrap|Line Numbers
  1. Private Sub chkTimer_AfterUpdate()
  2.     If Me.chkTimer.Value Then
  3.         Me.TimerInterval = nTimerInterval
  4.     Else
  5.         Me.TimerInterval = 0
  6.     End If
  7. End Sub

3 3535
jforbes
1,107 Expert 1GB
Put the requery code into the Form_Timer event. Then in the new Button's click event, set the Forms timer interval to 3000. ...3000 because the Form Timer uses milliseconds.

I use the following for a Checkbox to toggle a timer off and on:
Expand|Select|Wrap|Line Numbers
  1. Private Sub chkTimer_AfterUpdate()
  2.     If Me.chkTimer.Value Then
  3.         Me.TimerInterval = nTimerInterval
  4.     Else
  5.         Me.TimerInterval = 0
  6.     End If
  7. End Sub
Dec 16 '14 #2
twinnyfo
3,653 Expert Mod 2GB
P.S. For a three minute interval, TimerInterval should be 180000 (3 minutes, x 60 seconds x 1000 milliseconds).
Dec 16 '14 #3
jforbes
1,107 Expert 1GB
Haha, nice catch Twinnyfo!
Dec 16 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dalan | last post by:
I'm sure there is a workaround for this, but haven't found it yet. I have a mainform with two subforms and after one or both of the subforms are updated, then clicking the Refresh button on the...
6
by: Tim Marshall | last post by:
Here's the situation. A form, frmSetUp, with a subform control called subExplain with a source object form frmSetUpSubDefineSides. The source object is a bound form, displaying a few records, no...
6
by: Mark | last post by:
Hello. I have a listbox whose rowsource is set to a saved query (call it "qry_customer_list.") When I add customers to my database, I call the listbox Requery method so that the listbox will...
2
by: stan | last post by:
I'm sure I'm missing something simple here; help will be appreciated. I've got a search form that displays records from a MySQL db matching criteria entered by the user; the search form appears...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
3
by: LROCCO | last post by:
Hi, I have a form which contains a subform. When I'm entering data into the subform it seems to requery automatically. When this occurs the focus goes to the start of the subform. Firstly,...
2
by: Lyn | last post by:
Hi, I am using a form (FormA) to list the records in a recordset. In the FormA footer, I have an "Add" command button that opens a new form (FormB) modally which is used to input and save a new...
1
by: truckfin | last post by:
Hi, i know there has been a lot of posts on refreshing/requerying comboboxes. But I cant seem to get it to do what i want. i've got a bound subform set to continuous forms on a bound form that...
2
by: Arnold | last post by:
Hi Gurus, I am getting the error 3420 "object invalid or no longer set" at in the line -- rst.FindFirst "=" & NextPK --in the code below. I simply have a continuous main form that is, by...
6
by: ConfusedMay | last post by:
Hi, I'm using access 2003. I have a textbox called txtdate on the main form and when I click this textbox I have a calendar pop up and users can select which date they want it to be appear on this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.