First VBA learning experience

fleetman

Registered User.
Local time
Yesterday, 19:36
Joined
May 18, 2010
Messages
11
I have a database that contains a [UNITS] table, with {miles and hours} fields. This data base also has a [WORKORDERS] table that contains {miles and hours} fields.

A workorders form is used to open new workorders where current {miles and hours} fields are populated. A [CLOSED WORKORDER] button is (checked) when work is done, (M+/orH), parts and labor data is complete.

Currently I manually update the [UNITS] table {miles and hours} fields. I would like to VBA code or something,(?) so when workorder form [CLOSED WORKORDER] button is checked, the workorder form mileage/miles updates the [UNITS] table fields.

I DON'T KNOW HOW TO DO THIS, can anybody show me? / I might learn something.:rolleyes:
 
Last edited:
Sounds like you are trying to store a calculation in a table which goes against the normalization law that all database designers must adhere to. ;-) Calculations should be made at runtime when needed in a report or form.
 
Dear D&C,

The mileage or hour meter data changes with every workorder. Only Preventive Maintenance data is calculated from the values. in my old DOS application I entered the miles and hour meter data in the vehicle master and then in the workorder. Since I have to enter the data on everywork order, I thought I would reduce the number of steps by automating the updating old data in the units table with the new data entered on the workorders form with VBA. If I only knew how. I'll figure it out some how, some time, soon I hope.

Thanks for the interest,
 
Last edited:
Have you tried to build the update into the same form where you enter you original data?

If your issue is that Mileage Data is to be stored on two different tables but are related, ie same vehicle, then can you build a subform into the form where you first enter the mileage so both can either be entered at the same time or, the form can be set so when you enter data in one text box control it is repeated in the other.

You could have VBA update the field in your other Table with the data just entered in the text box control but subform will do this as well.
 
Thanks for the assistance.

Simple is better. I have done a couple of subforms, so I may give this a try. Anything I can learn to do that works is just what I need to do for now. I have ordered a book on VBA and when it comes in, I would like to something about code.

JC
 

Users who are viewing this thread

Back
Top Bottom