L
Lostguy
I need some help Barney-style with this. Using Access 2003, I am
missing something basic and it is kicking my a--.
I have a new business. It has 10 different job positions. I know those
in advance so I design a tblJob with fields named JobID (autonumber/
pk) and JobTitle (text).Using that table, I type in the 10 job titles
(Job1,Job2, etc.) into the JobTitle field. The AutoNumber numbers
those 1-10.
I know that I will have employees, so I create a tblEmployees with
fields EmployeeID(pk/autonumber), LastName, and JobID(long integer
number/FK from tblJob/ DefaultValue: Null)
I set up the relationship as one (JobID from tblJob) to many (JobID in
tblEMployees) because many employees could have the same one job. I
also enforce ref int (for every job, there has to be an employee who
has it), and cascade update (if a job title gets renamed, the rename
will be reflected by all the associated employees).
Now, I start bringing in the employees. What I would like to do is
have a form where I can a) type in the name of the employee (Smith)
and then b) select their job from a dropdown (Job8). I then should be
able to go back a table and see that relationship (that Smith has Job
8,or at least the record numbers for those in 2 columns)
1) Is the proper join type for this #2?
2) I can't seem to set up the form for this. Since I am typing data
into one table, and using a dropdown from another table, it doesn't
seem to work right. I tried to insert a subform with just the two
fields (LastName and JobTitle), but I keep getting errors or it won't
let me type in one or both of the fields. Should I be using subfomrs
or would a combo box do?
3) When I type in "Smith", it goes in the tblEmployees in the LastName
field with Autonumber 1. When select JOb 8, where does that value get
stored? Where does the Smith-to-Job8 relationship get stored?
4) Why would you ever base a form on a query? Don't you use forms to
display and input data INTO a table, and queries to extract/view (but
not input) data FROM a table???
I am using all the information I get! Thanks!
VR/
Lost
missing something basic and it is kicking my a--.
I have a new business. It has 10 different job positions. I know those
in advance so I design a tblJob with fields named JobID (autonumber/
pk) and JobTitle (text).Using that table, I type in the 10 job titles
(Job1,Job2, etc.) into the JobTitle field. The AutoNumber numbers
those 1-10.
I know that I will have employees, so I create a tblEmployees with
fields EmployeeID(pk/autonumber), LastName, and JobID(long integer
number/FK from tblJob/ DefaultValue: Null)
I set up the relationship as one (JobID from tblJob) to many (JobID in
tblEMployees) because many employees could have the same one job. I
also enforce ref int (for every job, there has to be an employee who
has it), and cascade update (if a job title gets renamed, the rename
will be reflected by all the associated employees).
Now, I start bringing in the employees. What I would like to do is
have a form where I can a) type in the name of the employee (Smith)
and then b) select their job from a dropdown (Job8). I then should be
able to go back a table and see that relationship (that Smith has Job
8,or at least the record numbers for those in 2 columns)
1) Is the proper join type for this #2?
2) I can't seem to set up the form for this. Since I am typing data
into one table, and using a dropdown from another table, it doesn't
seem to work right. I tried to insert a subform with just the two
fields (LastName and JobTitle), but I keep getting errors or it won't
let me type in one or both of the fields. Should I be using subfomrs
or would a combo box do?
3) When I type in "Smith", it goes in the tblEmployees in the LastName
field with Autonumber 1. When select JOb 8, where does that value get
stored? Where does the Smith-to-Job8 relationship get stored?
4) Why would you ever base a form on a query? Don't you use forms to
display and input data INTO a table, and queries to extract/view (but
not input) data FROM a table???
I am using all the information I get! Thanks!
VR/
Lost