how to show a pop up message depending on 2 field's value differences

sspreyer

Registered User.
Local time
Today, 06:36
Joined
Nov 18, 2013
Messages
251
hi,

all


hope someone can point me in the right direction

I have 2 fields on my form service interval combo box and vehicle mileage text box I m trying to create a pop up message on there values


if service interval is 12,000 and the mileage entered in the vehicle mileage is over 12,000 then show pop up message.

this works but I'm sure its wrong don't no why I need the -1 anyways here's what I have

Code:
 If Me.Vehicle_Mileage.Value > Me.Cboserviceinterval.Column(1) - 1 Then
 msgbox "test"
 end if
now my problem what I can't get it to work . I still want the pop up message
if say the service interval is 12,000 and mileage entered in the vehicle mileage is 1,000 miles below the service interval I still want the same pop message but if 2,000 or more below service interval then no pop up message

I have tried a number of sequences with no avail:banghead:

thank in advance any help much appreciated :D

shane
 
Based on your working example, something like:

If Me.Vehicle_Mileage.Value > Me.Cboserviceinterval.Column(1) - 1000 Then

but it sounds like you may be comparing apples to oranges. I would expect to compare a current odometer reading to the interval plus the last service. In other words, if the vehicle is at 23,000, the interval is 12,000 and the vehicle was first serviced at 12,123, I'd want to compare 23,000 to the "next service due" of 24,123.
 
thanks Paul Work's like a Charm

yeah see where your coming from makes sense something that I will looking into when I get some more time I rest a sure I will be probably bug you again for some help when I get round to it bound to get stuck. Anyways at leased the code above is now working to get me by for now

thanks again Paul you diamond

Shane



but it sounds like you may be comparing apples to oranges. I would expect to compare a current odometer reading to the interval plus the last service. In other words, if the vehicle is at 23,000, the interval is 12,000 and the vehicle was first serviced at 12,123, I'd want to compare 23,000 to the "next service due" of 24,123.
 
No problem Shane. I've written a couple of vehicle maintenance apps, and I included the ability to have required service intervals for various services (oil change every 5k, transmission service every 15k type of thing). Users can run a "due for service" report that shows anything within x miles of being due for any of them.
 

Users who are viewing this thread

Back
Top Bottom