Timer

T

Todd

I've got a vehicle maintenance database and would like to
know how I can set the mileage to when it increases over
3000 miles in the mileage field a notification is sent to
the screen or automatically prints a notification page
saying that an oil change is required for vehicle #111
(this is the one I'd prefer).

The way my form is set up is that at the end of every
month I'd enter a new record on each vehicle and the
beginning mileage and ending mileage is entered into
separate fields on each record as well as other info. I'd
imagine that I would use one of these fields to set the
timer? What is my best approach to accomplish this? I
haven't dealt with the timer property at all. Any help is
appreciated.
 
D

Dave - Freedonia

The approach that I used when 'testing' a database of this nature was to
use code to compare the mileage when the last oil change occured to the
current mileage, if the difference was more then 3,000 then it would
give a message stating this.

Are you keeping track of when oil changes occur for vehicle #111 and the
mileage at that time?
 
M

Mike Mueller

: I've got a vehicle maintenance database and would like to
: know how I can set the mileage to when it increases over
: 3000 miles in the mileage field a notification is sent to
: the screen or automatically prints a notification page
: saying that an oil change is required for vehicle #111
: (this is the one I'd prefer).
:
: The way my form is set up is that at the end of every
: month I'd enter a new record on each vehicle and the
: beginning mileage and ending mileage is entered into
: separate fields on each record as well as other info. I'd
: imagine that I would use one of these fields to set the
: timer? What is my best approach to accomplish this? I
: haven't dealt with the timer property at all. Any help is
: appreciated.

I wouldn't use a timer. I would use an unbound text box and
vba. Let's say you have a field for the last oil change
(Oc_Last) and a field for current miles (Miles_Current).
I'll say the unbound text box is (Text3). I would make it a
larger text box with larger text to stand out a little. I
tried this out with the folowing code

Private Sub Form_Current()

If (Oc_Last + 3000) < (Miles_Current) Then
Text3 = ("Oil Change Due")
Text3.ForeColor = RGB(255, 0, 0)
Else: Text3 = ("")
End If

End Sub

You could probably add on to this to set the text box to say
something like "oil change due in {xxx} miles" if you so
desired.

Seeings forms are generally used for data entry, you may
want to put that vba in the after update section of the
miles current: Private Sub Miles_Current_AfterUpdate()

Good luck. Doesnt't seem like it will that hard to achieve

mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top