PC Review


Reply
Thread Tools Rate Thread

Design Question: Form controls run queries at X interval

 
 
John
Guest
Posts: n/a
 
      9th Nov 2008
I have a form where the user assigns values to 5 combos. Each combo
represent a timed interval (e.g., 1 min, 3 min, 5 min, etc).

I have a form where a user will decide how often each of five (append)
queries will run. So, the form has five combos that each represent a
different query.

For example, the user sets combo A to "2 min". This will have the
system execute query A every 120 sec. Combo B is set to "3 min", which
will have query B executed every 180 sec.

The form interval event works fine if only one interval setting
applied to all combos---where query A, B both run at the same time.

Is there a better way to approach this?
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      10th Nov 2008
Assuming that the comboboxes are set for a number of minutes and have a column
that lists the minute count

Set the timer interval to 60000 (sixty seconds)

Private Sub Form_Timer()
Static Icount As Long

Icount = Icount + 1 Count the minutes

ICount = (ICount + 1) Mod 60*24 'Reset the counter every Day

If ICount Mod ComboA = 0 then
'execute
End if

If ICount Mod ComboB = 0 then
'execute
end if


If ICount Mod ComboC = 0 then
'execute
end if

End Sub

If the comboboxes were strictly text you could use
If ICount Mod Val(ComboA) = 0 Then
'execute
End If


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

John wrote:
> I have a form where the user assigns values to 5 combos. Each combo
> represent a timed interval (e.g., 1 min, 3 min, 5 min, etc).
>
> I have a form where a user will decide how often each of five (append)
> queries will run. So, the form has five combos that each represent a
> different query.
>
> For example, the user sets combo A to "2 min". This will have the
> system execute query A every 120 sec. Combo B is set to "3 min", which
> will have query B executed every 180 sec.
>
> The form interval event works fine if only one interval setting
> applied to all combos---where query A, B both run at the same time.
>
> Is there a better way to approach this?

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      10th Nov 2008
Thanks for the ideas, Chris and John. I'll play around with that.




On Nov 10, 6:37*am, John Spencer <spen...@chpdm.edu> wrote:
> Assuming that the comboboxes are set for a number of minutes and have a column
> that lists the minute count
>
> Set the timer interval to 60000 (sixty seconds)
>
> Private Sub Form_Timer()
> Static Icount As Long
>
> Icount = Icount + 1 *Count the minutes
>
> ICount = (ICount + 1) Mod 60*24 'Reset the counter every Day
>
> If ICount Mod ComboA = 0 then
> * * 'execute
> End if
>
> If ICount Mod ComboB = 0 then
> * * 'execute
> end if
>
> If ICount Mod ComboC = 0 then
> * * 'execute
> end if
>
> End Sub
>
> If the comboboxes were strictly text you could use
> If ICount Mod Val(ComboA) = 0 Then
> * * 'execute
> End If
>
> John Spencer
> Access MVP 2002-2005, 2007-2008
> The Hilltop Institute
> University of Maryland Baltimore County
>
>
>
> John wrote:
> > I have a form where the user assigns values to 5 combos. Each combo
> > represent a timed interval (e.g., 1 min, 3 min, 5 min, etc).

>
> > I have a form where a user will decide how often each of five (append)
> > queries will run. So, the form has five combos that each represent a
> > different query.

>
> > For example, the user sets combo A to "2 min". This will have the
> > system execute query A every 120 sec. Combo B is set to "3 min", which
> > will have query B executed every 180 sec.

>
> > The form interval event works fine if only one interval setting
> > applied to all combos---where query A, B both run at the same time.

>
> > Is there a better way to approach this?- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copied controls are in different location on form when viewed in design / form view Jarryd Microsoft Access Forms 3 25th Jan 2009 12:31 PM
how to re-draw controls on a Form at a regular interval? =?Utf-8?B?R2Vvcmdl?= Microsoft C# .NET 8 6th Dec 2006 07:27 AM
how to re-draw controls on a Form at a regular interval? =?Utf-8?B?R2Vvcmdl?= Microsoft Dot NET Compact Framework 0 26th Nov 2006 02:46 PM
Form that controls queries. =?Utf-8?B?cG90dGVy?= Microsoft Access 5 2nd Feb 2006 10:08 PM
Re: Fundamental design question - Queries driving forms TC Microsoft Access Database Table Design 1 13th Sep 2003 10:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.