B
Bruce
This is a sort of repost of a similar question. Thanks to
those who provided help, but I still have questions, and
have clarified what I am trying to do. I think it is best
to start a new thread.
My startup screen contains a combo box of department
names. Each name has a corresponding abbreviation (e.g.
Quality is "Q"). The combo box source is a table
(tblSelectDept) that contains 3 columns: Autonumber,
Department Name, and Abbreviation. The idea is that a
user will select a department (e.g. Quality), and a form
(frmMainForm) will open with the identifying number Q-04-
01 filled in. Q is the department abbreviation, 04 is the
year, and 01 is the first Quality department record for
the year. The next time somebody selects Quality from the
department list in the combo box the identifying number
will be Q-04-02. Production will be P-04-01, etc. The
first record for any department will end with "01", the
second with "02", etc.
Since I will one day want to query the records for such
things as all those related to the Quality department, or
all those for a particular year, I think it is best if I
have a table field for Department Abbreviation
[DeptAbbrev], and one for Year [Year]. Department
Abbreviation will sometimes be two letters. I don't need
to keep the last two digits (01, 02, etc.) of the
identifying number in their own field, but will do so if
it helps. The way I see this working is that clicking on
the department name in the combo box will cause
[DeptAbbrev] & "-" & [Year] & "-" & (the last two digits)
to appear in the [IDnumber] field on the form (and be
stored in [IDnumber] in the underlying table (tblMain).
The question is "How"?
I plan to use autonumbers for primary keys (field name is
[ID]) in all tables unless I would do better otherwise.
Records will be stored in a single table (tblMain).
[IDnumber] (e.g. Q-04-01) will be among the fields stored
in tblMain. [IDnumber] will be unique, by the way, so as
far as that goes it could be the primary key, if needed.
I would think [DeptAbbrev] and [Year] will also be stored
in tblMain.
That is probably enough information for now. I am glad to
adjust my assumptions about how this will be done if they
are off track. If you have gotten this far, thanks for
your patience.
those who provided help, but I still have questions, and
have clarified what I am trying to do. I think it is best
to start a new thread.
My startup screen contains a combo box of department
names. Each name has a corresponding abbreviation (e.g.
Quality is "Q"). The combo box source is a table
(tblSelectDept) that contains 3 columns: Autonumber,
Department Name, and Abbreviation. The idea is that a
user will select a department (e.g. Quality), and a form
(frmMainForm) will open with the identifying number Q-04-
01 filled in. Q is the department abbreviation, 04 is the
year, and 01 is the first Quality department record for
the year. The next time somebody selects Quality from the
department list in the combo box the identifying number
will be Q-04-02. Production will be P-04-01, etc. The
first record for any department will end with "01", the
second with "02", etc.
Since I will one day want to query the records for such
things as all those related to the Quality department, or
all those for a particular year, I think it is best if I
have a table field for Department Abbreviation
[DeptAbbrev], and one for Year [Year]. Department
Abbreviation will sometimes be two letters. I don't need
to keep the last two digits (01, 02, etc.) of the
identifying number in their own field, but will do so if
it helps. The way I see this working is that clicking on
the department name in the combo box will cause
[DeptAbbrev] & "-" & [Year] & "-" & (the last two digits)
to appear in the [IDnumber] field on the form (and be
stored in [IDnumber] in the underlying table (tblMain).
The question is "How"?
I plan to use autonumbers for primary keys (field name is
[ID]) in all tables unless I would do better otherwise.
Records will be stored in a single table (tblMain).
[IDnumber] (e.g. Q-04-01) will be among the fields stored
in tblMain. [IDnumber] will be unique, by the way, so as
far as that goes it could be the primary key, if needed.
I would think [DeptAbbrev] and [Year] will also be stored
in tblMain.
That is probably enough information for now. I am glad to
adjust my assumptions about how this will be done if they
are off track. If you have gotten this far, thanks for
your patience.