How do I count Uses rather than Dates

K

Kathy

I have built an access data base for Preventive
maintenance.
My problem is this. Some machines need to certain tasks
performed after 5 uses, 30 uses, some daily, monthly, etc.
But
not on cesecutive days..some may be used once a week or
once every other day.
For now I am trying to figure out the 5 use part. I have
them log in each time the machine is used and an ondate is
entered. What I can't get is how to count each time the
machine has been turned on 5 times and needs a task
preformed and some how flags the operator the task is due.
Then resets itself to count the next 5 uses, etc.
Any help I could get would be very much appreciated.
What I would like to do is when the PM No. and Ondate is
entered it would pull up the tasks due for that day.
My Tables are as follows:
tbl Machine Onday tbl Machine ID Tasks Table
Machine OndayID Machine ID Task ID
Machine ID PM No Machine ID
Onday Date Equipment Name Task Notes
Location
Property Tag
Serial No
Rev Level
Notes

There are more tables but they have to do with other
functions
 
R

Rebecca Riordan

Okay, this is going to be tricky. It sounds like you have two different
types of PM schedules, call them perUse or perDay. What I would do is
create three different tables. One for the machine, containing the
attributes common to all machines, including the ID, and adding a PMType
field that contains either "perUse" or "perDay", then a table for each of
those types. The basic structure of the two table would be similar, but
they'd be updated differenty:

PerUse
MachineID
NumberUses
CurrentUses

PerDay
MachineID
NumberDays
LastPM

Each table is related to the Machine table one-to-one.

Now, when the user indicates that the machine is used, you can simply check
the appropriate table to determine whether PM is necessary. If it isn't,
you can increment the NumberUse of PerUse machines.

Does that make sense to you?

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
K

Kathy

I am TOTALLY lost...would you be willing to take a look at
my Data base and see where I have gone wrong??
 
R

Rebecca Riordan

Kathy,

Yes, of course. Make a little sample--delete most of the records (and
anything the least bit confidential), and email it to me. (You'll need to
take NOSPAM out of my reply address).

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 

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

Top