Auto Fill multiple variables

B

BMaerhofer

Hello,
I need to have the form update with a future Mileage.
I have a Mileage field, Next_Oil_Change field (checkbox), and Vehicle field
(dropdown).

I have a checkbox for what type of repair that it is, I need it to put a
future mileage based on if the Oil_Filter Change box is check marked. I need
two options with this as well.

1. Oil_Filter Change checked = 4000 miles added to Next_Oil_Change box -
all other cars get 4000 unless truck is selected!
2. Oil_Filter Change checked = 7000 miles added if Truck is selected from
vehicle type Next_Oil_Change box
3. Oil_Filter Change NOT checked = The program doesnt fill in the
Next_Oil_Change box.


Private Sub Mileage_AfterUpdate()
If Mileage > 0 And "Oil_Filter Change" = True Then
[Next_Oil_Change] = Mileage + 4000

If Mileage > 0 And Vehicle = TRUCK Then
[Next_Oil_Change] = Mileage + 7000

End If
End If
End Sub

-- This will work for the 4000 mileage range but not the 7000, and it is
ignoring if the checkbox is checked or not.

Thanks!!
 
K

Klatuu

Private Sub Mileage_AfterUpdate()
If Me.Mileage > 0 And Me.[Oil_Filter Change] = True Then
If Me.Vehhicle = "TRUCK" Then
Me.[Next_Oil_Change] = Mileage + 7000
Else
Me.[Next_Oil_Change] = Mileage + 4000
End If
End If
End Sub
 
B

BMaerhofer

Now I need help with one other thing regarding this.

How do I display the information for each vehicle on the main display. I
can't figure out how to code this information.

What I need it to do is look for the newest oil change inputted either where
it looks at newest date and oil_filter change is checked or greatest
next_oil_change mileage entered for each car. Then have it display in a box
on the main menu so you know when the next oil change is for each car.

I can send database or screenshots if needed.


Thanks!
Brian
--
BWM


BMaerhofer said:
Worked Great!! THANKS!!
--
BWM


BMaerhofer said:
Hello,
I need to have the form update with a future Mileage.
I have a Mileage field, Next_Oil_Change field (checkbox), and Vehicle field
(dropdown).

I have a checkbox for what type of repair that it is, I need it to put a
future mileage based on if the Oil_Filter Change box is check marked. I need
two options with this as well.

1. Oil_Filter Change checked = 4000 miles added to Next_Oil_Change box -
all other cars get 4000 unless truck is selected!
2. Oil_Filter Change checked = 7000 miles added if Truck is selected from
vehicle type Next_Oil_Change box
3. Oil_Filter Change NOT checked = The program doesnt fill in the
Next_Oil_Change box.


Private Sub Mileage_AfterUpdate()
If Mileage > 0 And "Oil_Filter Change" = True Then
[Next_Oil_Change] = Mileage + 4000

If Mileage > 0 And Vehicle = TRUCK Then
[Next_Oil_Change] = Mileage + 7000

End If
End If
End Sub

-- This will work for the 4000 mileage range but not the 7000, and it is
ignoring if the checkbox is checked or not.

Thanks!!
 
K

Klatuu

I don't know enough about your data to be able to give you an exact answer.
Do you mean you want to see one record that has the highest milage since the
last oil change? When you say newest date, that means to me most recent
date. Seems you would want the oldest date for a vehicle that needs an oil
change.

I really don't have a way to receive your database and these newsgroups are
for the benefit of all participants. It is customary to post all questions
and answers here someone else with a similar problem can get information.

To receive your database and do any work on it, I would have to charge a fee
for that.
--
Dave Hargis, Microsoft Access MVP


BMaerhofer said:
Now I need help with one other thing regarding this.

How do I display the information for each vehicle on the main display. I
can't figure out how to code this information.

What I need it to do is look for the newest oil change inputted either where
it looks at newest date and oil_filter change is checked or greatest
next_oil_change mileage entered for each car. Then have it display in a box
on the main menu so you know when the next oil change is for each car.

I can send database or screenshots if needed.


Thanks!
Brian
--
BWM


BMaerhofer said:
Worked Great!! THANKS!!
--
BWM


BMaerhofer said:
Hello,
I need to have the form update with a future Mileage.
I have a Mileage field, Next_Oil_Change field (checkbox), and Vehicle field
(dropdown).

I have a checkbox for what type of repair that it is, I need it to put a
future mileage based on if the Oil_Filter Change box is check marked. I need
two options with this as well.

1. Oil_Filter Change checked = 4000 miles added to Next_Oil_Change box -
all other cars get 4000 unless truck is selected!
2. Oil_Filter Change checked = 7000 miles added if Truck is selected from
vehicle type Next_Oil_Change box
3. Oil_Filter Change NOT checked = The program doesnt fill in the
Next_Oil_Change box.


Private Sub Mileage_AfterUpdate()
If Mileage > 0 And "Oil_Filter Change" = True Then
[Next_Oil_Change] = Mileage + 4000

If Mileage > 0 And Vehicle = TRUCK Then
[Next_Oil_Change] = Mileage + 7000

End If
End If
End Sub

-- This will work for the 4000 mileage range but not the 7000, and it is
ignoring if the checkbox is checked or not.

Thanks!!
 

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

Similar Threads

Auto Calculate Form 1
Required Fields Multiple 3
vehicle maintenance 10
How to estimate a future service date? 1
Validate Required 2
logic help needed - MPG calculation 16
No Luck 1
Make invisible with a checkbox 3

Top