Ok Now I have,
tblUniformTransactions
TransactionsID, OrderID, EmployeeID, ArticleID, Size, Quantity, Integrity,
Integrity is for the condition the order is received.
For example sometimes the order is incorrect by size, color, or style. Other
times the order is short, or missing items. Sometimes both.
The uniforms are ordered on a individual bases, an employee is allotted a
annual dollar amount, based on their hire date, that's why I had anniversary
date in the table, but maybe it should be on a different table, like the
employee table.
The orders are wrote out by hand & faxed.
The faxed form has an ID for the article and description as well.
tblUniformOrders
OrderID, EmployeeID, AnniversaryDate, Department, DateOrdered, DateReceived,
Duration, Integrity, Supplier.
I'm not sure how to assign the key. When I try I receive this message,
Primary Key cannot contain a null field.
:
comments inline.
tbluniformOrders; Order ID, Employee ID, Employee Name, Anniversary Date,
Department, Date Ordered, Date Received, Duration, Integrity, Supplier.
tbluniformOrders
OrderID (primary key, i assume)
EmployeeID (does not belong in this table, unless each entire order will
*always* be for one or more articles for a single employee only)
EmployeeName (does not belong in this table, period. the employee's name
should only be defined in the employee table.)
DateOrdered (okay)
DateReceived (okay)
Duration (i'm not sure - what is this?)
Integrity (ditto above)
Supplier (okay, again assuming that each entire order will *always* go to a
single specific supplier)
tblUniformtransactions; Order ID, Employee Name, Article, Size, Gender,
Quantity, Department, Integrity, Supplier.
I think your right. Looks like I should remove some from tbluniformOrders.
tblUniformtransactions
OrderID (if this is the primary key, recommend you name it something else,
like TransID, assuming that the primary key of tbluniformOrders is named
OrderID. if this is the foreign key from tbluniformOrders, that's fine, but
then where is the primary key field for this table?)
EmployeeName (this is iffy. are you providing the name in the order because
it will be put on the uniform? AND might the employee's name change between
one uniform order and the next? if both are true, then yes it makes sense.
but if you're just doing it to feel better because you're using to seeing
employee information in a transaction record - Excel-style - then you need
to get past that psychological block and embrace relational design
principles.)
Article (okay)
Size (okay)
Gender (do you sometimes order a male uniform for a female employee or vice
versa? or does an employee's gender sometimes change between one order and
the next? if no to both questions, this field doesn't belong in this table;
it belongs in the employees table.)
Quantity (okay)
Dept (somewhat iffy. i'd imagine that employees might move from one dept to
another, so i can see a legitimate need for tracking point-in-time dept
there. and if you might order uniforms for more than one dept in the same
order, that's also a legitimate need for dept in this table. if you're not
sure, re-analyze your process.)
Integrity (?? you have an Integrity field in tbluniformOrders. is there a
need to track at both the order level AND at the
transactions-within-an-order level? if the two Integrity fields describe the
same thing, my guess is that it's inappropriate to have the field in both
tables; you have to ask yourself: does the Integrity value describe an
order as a whole? or does the value only apply separately to each
transaction within an order?)
Supplier (does not belong in this table OR does not belong in
tbluniformOrders. you have to analyze your process. will each order go to a
single supplier? if so, then the Supplier field belongs in tbluniformOrders
*only*. or may a single order go to many suppliers, transaction by
transaction? if so, then the Supplier field belongs in
tblUniformtransactions only. but having the field in both tables makes no
sense.)
just as a side note, suggest you 1) be consistent in how you name your
tables (and all other objects you create in Access); it makes it easier for
anyone who looks at the database, and especially SQL statements and VBA
code, to read and understand the names - my personal naming convention is
lowercase prefixes with multiword names having first-letter capitalization,
such as tblUniformOrders, tblUniformTransactions - and, 2) don't put spaces
in the names of anything you name in Access; for more information, see
http://home.att.net/~california.db/tips.html#aTip5.
hth
:
okay, but's let's back up a minute. before i address your form question,
tell me what the table(s)/fields names for your orders tables, because
already i believe you're breaking normalization rules - so we want to
fix
that before you work on forms.
hth
Ok I think I have that set up. I have on my Uniform orders form,
Employee
ID(combo box), Employee Name, anniversary date, Job title, and Date
Ordered
Date Received, Supplier (combo box).
I have the employee id combo box Row Source,
SELECT Employee.[Employee ID], IIf(IsNull([Last
Name]),IIf(IsNull([First
Name]),[Job Title],[First Name]),IIf(IsNull([First Name]),[Last
Name],[First
Name] & " " & [Last Name])) AS [Employee Name], Employee.[Anniversary
Date],
Employee.[Job Title] FROM Employee ORDER BY IIf(IsNull([Last
Name]),IIf(IsNull([First Name]),[Job Title],[First
Name]),IIf(IsNull([First
Name]),[Last Name],[First Name] & " " & [Last Name]));
And the column count at 5, the widths 0.5";1.6";0.8";1";1". What this
shows
is the Employee ID, Employee Name, Anniversary Date, and Job Title.
When
I
use the combo box it populates only the Employee ID. Is there a way
to
make
this combo box auto fill others?
In the sub form I have order ID, employee name, Article, Size,
quantity,
Gender, department, supplier.
I should change some of that. Any way that's where i'm at.
:
no problem, i'll be around; i try to check the ngs once an evening,
when
i'm
involved in a thread.
btw, i notice i forgot to include a quantity field in
tblOrderDetails -
oops! you'll want to include whatever fields in tblOrderDetails that
you
need to describe a specific order detail. and if you find order
details
confusing, it may help to think of them as line items on invoices
(or
sales
order) - one record equals one line item on one invoice/sales order.
hth
Thank you, I'll give that a try, it may take a while. But I'm sure
I'll
have
more questions.
:
i want to expand on my statement posted elsewhere in this
thread.
yes. don't try basing an Orders data entry form on a
multi-table
query.
you
don't need it, and there's a good change it wouldn't be
updateable
after
you'd written it.
a multi-table query is often very useful for reports, and for
forms
where
data is going to be *reviewed* rather than added/edited. and
yes,
*sometimes* in forms where data will be edited, as well. but
it's a
common
mistake of new users to try to use a single form to add/edit
records
in
multiple tables, just because the data in those tables are
related -
and
in
most cases, it's just not appropriate, or even the easiest way
to do
it.
i
would be most likely to use a multi-table query as a data entry
form's
RecordSource when the tables involved have a one-to-one
relationship,