Okay, this is probably the most productive discussion I've had about
this since I've begun. Thank you Graham. I'll answer your questions
and add some of my own to the mix. And I'll concede to the operators
table...I think it's a good idea now that you explained it more.
Firstly, I'll explain an FSI and Runs like you asked at the end of your
last post.
An FSI is a cleaning device that can clean up to 6 runs (aka lots to
some people, it just depends on your preference, but everyone who works
here understands either) which all have a unique run number associated
with it that is carried throughout the facility. A run is also a group
of 25 potential products.
So that can bring us to my last question: What would happen if a run
number went through an FSI more than once (e.g. it was cleaned more
than once, which happens very regularly)? I believe that it wouldn't
matter since the PassID and RunNumber will both be primary keys and
therefore I will never have a single run number going through the same
pass and never creating a duplicate entry in *Runs*. As well as the
chance that it will go through the same peice of machinery (FSI).
I hope that's enough. I'm not really allowed to disclose what it is
that we do because of government contracts. Sorry that I can't go more
in depth.
Now, to move back into the discusion:
You DO need a unique pass number for each pass, because that's the only
way
to link the pass with the runs for that pass. If it's not unique, then
how
can you tell which pass a run with PassNumber=13 belongs to? Was it pass
13
for FSD#1 or FSD#2, and was it pass 13 from this week, or from several
recharges ago?
I'll put a unique identifier, but I am very reluctant to use auto
number because I've found that it can become slightly messy if edits or
deletions are necessary. Do you have any suggestions on this? Also,
how would I calculate the number of passes since the last recharge and
display this value on a form (which was the ultimate goal of this
thread, and I am determined to figure this out)?
Yes, I can see you need an FSIs table. It needs a minimum of two fields:
FSINumber - Numeric, integer, primary key - values 1, 2, 3
LastRecharge - Date/Time
Check, but how do I tell it (or have it retrieve) what the last
recharge date was?
And I'm just starting to run this through my head: how do I keep track
of the need for each FSI to be recharged. Since there are 3 machines
and the information for every pass on all 3 are stored in the same
table, how will I sort out which FSI has had 5 passes since recharge
and which has had 19 since recharge?
Here is my updated table structure:
*Passes*
PassID, Number, Primary Key, link to *Runs*>PassID
FSINumber, Number, link to *FSIs*>FSINumber
DateTimeOut, Date/Time, default Now()
Operator, Text, Link to *Operators*> (I'm not sure if I should link
this to peratorID or OperatorInitials)
Pre, Number
Post, Number
Comment, Memo
*Operators*
OperatorID, AutoNumber, (maybe) link to *Passes*>Operator
OperatorName, text
OperatorInitials, text (maybe) link to *Passes*>Operator
*Runs*
PassID, Number, link to *Passes*>PassID
RunNumber, Number
*FSIs*
FSINumber, Number, link to *Passes*>FSINumber
RCHGDate, date/time
If you see anything wrong, please point it out. And could you tell me
which link would be better on *operators*?
Thanks for your help, it's greatly apreciated.
Graham Mandeno wrote:
Hi Fletcher
I'll answer you questions and points inline...
Thank you Graham for all your helpful information. I don't know that
everything that you have said is necessary for my database, but I
believe that some of it would help. I'll do my best to explain why I
do or do not think that what you told me is necessary. Please don't
take this as a blow to your person.
Hey - it takes a LOT more than that to offend me!
I'll start by saying that your proposed tables for FSIs and Operators
would be pointless in our facility. Mainly because we don't desire -
yet - to have information on those stored electronically, but it may
happen in the future. Although, I may look at creating an FSI table
now for reasons that I'll mention later.
Yes, I can see you need an FSIs table. It needs a minimum of two fields:
FSINumber - Numeric, integer, primary key - values 1, 2, 3
LastRecharge - Date/Time
There are two reasons why I would still recommend an Operators table:
1. it makes data entry easier, because you can use a combo box which
does autocomplete to select the operator
2. it prevents errors - for example, typing the initials HM when you
mean GM
It doesn't need to be complex:
OperatorID - autonumber, primary key
OpName - text, no duplicates
OpInits - text, no duplicates (if you need this for a short field in
forms/reports)
Your proposed table called *Passes* is basically what I already have.
It includes the pass number, which is what I would like to count from 1
to 20 and then start over (and is what started this thread); it
includes the date/time, which I have condensed to one entry instead of
two; it includes the operator ID, which in our facility is simply
initials; it contains the pre_meas and post_meas; it also contains
comments. This table also brings us to the problem. You tell me that
I need to have a unique pass number for each pass, and I say that I
only want numbers 1 to 20. I'll come back to this.
You DO need a unique pass number for each pass, because that's the only
way
to link the pass with the runs for that pass. If it's not unique, then
how
can you tell which pass a run with PassNumber=13 belongs to? Was it pass
13
for FSD#1 or FSD#2, and was it pass 13 from this week, or from several
recharges ago?
You DO NOT need a counter for the number of passes since the last
recharge,
as the number of pass records since that date can easily be counted.
To continue, I don't really see a point in a having a table for
Recharges. Again simply because we don't care to have infomation
stored about this process. We only desire to know that it happened.
Which we would know when the pass number entry resets to 1.
Fine - if you have no need to record recharge history then all you need
is a
LastRecharge field in the FSIs table (see above).
However, when someone comes to you in the future and says: "Can you tell
me
how many times this FSI has been recharged in the last year?", then I
would
be the first to say "I told you so!"
What I am interested in is having a table for Passes and a table for
runs linked because we can have multiple runs in a single pass and we
would like to later be able to search for a given run and see all the
information about it. This takes us back to the table for passes and
the table for FSIs...
I would like to have the three table set up similar to what you've
explained. I would like to have the Pass Table that you described,
and the Run table that you described, and I believe that this set up
will also require the FSI table you described. Perhaps you can help me
with this. I'll explain further.
I would like to have:
*FSI*
FSI_ID, Number (we only have 3 machines, so these would be 1, 2, or 3)
*Runs*
Pass_ID, Number (to link to *Pass* coming up)
Run_Number, Number (5digit ID number that remains constant throughout
each step in the facility)
*Pass*
Pass_ID, ? (I'm reluctant to use autonumber)
Pass_Number (Numbers 1 through 20, unless there is some other way to
display on a form how manny passes have been done since recharge?)
Date/TimeOut, Date/Time, Now()
FSI_ID, Number (to link to *FSI*)
Operator, Text (2 or 3 letter initials of operator simply to know who
ran the pass)
Pre, Number
Post, Number
Comments
Now, in your description of *Runs* you said that Pass_ID and Run_Number
could be combined to form a primary key? I am not sure how to do this.
The easiest way is to open the table in design view, select BOTH the
fields,
and then click the primary key button on the toolbar.
And I am most definitely not sure how to link the tables as everyone
talks about. I hope I have satisfied you by deciding to revamp my
database. If you could help me through this, I would be most
apreciative. Thank you.
Click on Tools>Relationships. Then you can add tables to the window
(View>show tables) and drag the mouse from the primary key of one table
to
the related field (foreign key) of another.
One more question though. If I were to do this, what would happen if a
given "Run" went through a FSI more than once?
Not quite sure what you mean by this. I think you'll need to explain a
bit
more about exactly what a run is, and what an FSI does.
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand