Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Auto Fill multiple variables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BMaerhofer - 29 May 2008 19:37 GMT
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!!

Signature

BWM

Klatuu - 29 May 2008 20:53 GMT
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

Signature

Dave Hargis, Microsoft Access MVP

> Hello,
> I need to have the form update with a future Mileage.
[quoted text clipped - 27 lines]
>
> Thanks!!
BMaerhofer - 30 May 2008 12:07 GMT
Worked Great!! THANKS!!
Signature

BWM

> Hello,
> I need to have the form update with a future Mileage.
[quoted text clipped - 27 lines]
>
> Thanks!!
BMaerhofer - 30 May 2008 12:40 GMT
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
Signature

BWM

> Worked Great!! THANKS!!
>
[quoted text clipped - 29 lines]
> >
> > Thanks!!
Klatuu - 30 May 2008 15:12 GMT
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.
Signature

Dave Hargis, Microsoft Access MVP

> Now I need help with one other thing regarding this.
>
[quoted text clipped - 44 lines]
> > >
> > > Thanks!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.