If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Make table query to execute every 5 minutes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 84
Make table query to execute every 5 minutes

I want to execute one make table query which has to put the data into MS Access table from linked MS SQL Server database based on group by clause, every five - ten minutes.

I have huge MS SQL Server database, I linked it to MS Access database (one linked table). I made another table in MS Access which would be the destination table for mentioned make table query. The make table query should be executed against MS SQL Server database every 5 - 10 minutes.

Already have everything but the timing mechanism. I do not think it can be achieved using macros. Only Visual Basic.

Anybody has experience with something like this?
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Location: belgium
Posts: 290
Have a try with the OnTimer-property.

To run a macro or event procedure when this event occurs, set the OnTimer property to the name of the macro or to [Event Procedure].

See also the help file of MsAccess.

emiel
Reply With Quote
  #3 (permalink)  
Old
Moderator
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 2,406
Here you go:

Sub Form_Load()
Me.TimerInterval = 300000 'Five Minutes (1000/sec)
End Sub

Sub Form_Timer()
Place your Macro call here
End Sub
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2003/2007
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Oct 2004
Posts: 57
i always found it was easier to run a batch file from a scheduler...

start /w msaccess.exe c:\database.mdb /x "MacroName"
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 84
Timer, timerinterval, are there just for this reasons.

I tried using them, but there's a lack of good examples at Internet.

Anybody found good practice sites having examples about this?
Reply With Quote
  #6 (permalink)  
Old
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,910
Nope - but so long as you are comfy with code and events you will do fine.

You have two things to think about -
OnTimer event fires everytime the timer "goes off"
TimerInterval (in milli seconds) is how long between timer events (where 0 turns the timer off entirely).

So - as missinglinq put it - set your timer interval to 3000 and your timer event will fire every 5 mins.

Not much more to it You can look at the Access VBA help entry but you won't find much more there.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On