pop ups

jonamua1971

Registered User.
Local time
Today, 11:03
Joined
Mar 3, 2007
Messages
97
I thank you for all your help.
im working on database and i have some challeges.
i have a table that has vehicles informationas follows:
vin#, oil change date, tire rotations date,registration plate and color
i trying to make a form that will show all the above information but i want
a pop up to show that the car is due for oil change in two week then one week then three days.
i am still working on my vba. please if you can help with some code that will be helpful.
Thanks
 
Simple Software Solutions

Hi

If the form that contains the data is a bound form then you could call a function on the OnCurrent property of the form, such as

Dim Msg as String
Dim iDays as Integer
iDays = DateDiff("d",[OilChangeDate],Date())

Select Case iDays

Case <=7 : Msg = "Oil Change due within the next week"
Case <=14: Msg = "Oil Change due sometime next week"
Case xxx

End Select

MsgBox Msg,,"Oil Change"

The message and the values can be determined by yourself.

Remember to check that a date is entered into the oil change date or it
will cause an error in the DateDiff Function()

Codem Master:cool:
 
thank you!
 
pop up error

Hi DCrake,
thank you for your response .
i tried to do as instructed but i got an error as follows:
run time error '2465"
microsoft access cant find the feild "i" referred to your expression.

Below is what i did
i put the code behing the oil change date due on before update in a form.
no code behind the oil change actual date done.
did i confused the vba ?
Dim Msg as String
Dim iDays as Integer
iDays = DateDiff("d",[OilChangeDate],Date())

Select Case iDays

Case <=7 : Msg = "Oil Change due within the next week"
Case <=14: Msg = "Oil Change due sometime next week"
Case xxx

End Select

MsgBox Msg,,"Oil Change"
 
Simple Software Solutions

Hi

Please find a sample of your requirements for both bound and unbound forms

Code Master:cool:
 

Attachments

Users who are viewing this thread

Back
Top Bottom