Sharing Combo Box data with other Combo Box

A

Access Beginner

I am trying to create a time sheet. We have several projects and under each
project we have multiple tasks. I would like our employees to use the first
combo box to select the project. With the selected project I would like our
employees to select only the task related to that project in the second box.
I have a continous subform. I have tried quries where the project ID is used
to limit the task, but when I move to the next project the previous task
changes with the new project.

Any suggestions?
 
L

Larry Daugherty

Not sure I grasp what you're doing but could it be that you are really
using a table view in your subform?

In the usual form/subform paradigm, the suubform control will actually
hold one or more distinctly different records. Look in Help for
Form/Subform and read with fresh eyes. It used to be pretty good at
explaining and stepping the user through the whole process of getting
it going.

Try this: design a subform without header or footer and make it no
bigger than a single record in your current setup. It's really a
regular form but since you intend to use it as a subform, prefix it
with "suf" rather than "frm". (I made that up). Set its default view
to continuous forms. The subform should have the same two comboboxes
you're already working with. Unless, of course, the comboboxes you're
looking at are the dreaded Lookup Fields. If they are, go read about
Lookup Fields on www.mvps.org/access Your subform's data source
should be a query that makes sense in your intended context.
Typically it would contain a foreign key that is the same name as the
primary key of the data source for the "main" form.

Make a copy of your current "main" form and delete the current subform
control from the copy

With the target "main" form in design view and at less than full
screen, select your new "sufForm" and drag it into the desired
location in the target form.

If you got it right to that point then look at the properties of your
subform control and you should see Link Master Field and Link Child
Field each with a field of the same name (or at least the same sense).

HTH
 
A

Access Beginner

Larry,
Thanks for the response. I believe I have my form and sub form connected in
the the way you explained. The main form has the employee with an employee id
(master link). The subform contains the employee id (child link), project id,
and task id. My problem is between the project id and the task id. Within the
first record I choose a specific project, which is saved to project ID.
Through a query, the selected project determines the list of task in the Task
Combo box. I select the task and it is saved in the Task ID. Now when I go to
the next record and choose a new project. The task in the first record
changes to the new selected project. How can I hold the first task and create
a new task list in the second record?

Can you help or am I over my head?
--
Thanks for the Help!
Access Beginner


Larry Daugherty said:
Not sure I grasp what you're doing but could it be that you are really
using a table view in your subform?

In the usual form/subform paradigm, the suubform control will actually
hold one or more distinctly different records. Look in Help for
Form/Subform and read with fresh eyes. It used to be pretty good at
explaining and stepping the user through the whole process of getting
it going.

Try this: design a subform without header or footer and make it no
bigger than a single record in your current setup. It's really a
regular form but since you intend to use it as a subform, prefix it
with "suf" rather than "frm". (I made that up). Set its default view
to continuous forms. The subform should have the same two comboboxes
you're already working with. Unless, of course, the comboboxes you're
looking at are the dreaded Lookup Fields. If they are, go read about
Lookup Fields on www.mvps.org/access Your subform's data source
should be a query that makes sense in your intended context.
Typically it would contain a foreign key that is the same name as the
primary key of the data source for the "main" form.

Make a copy of your current "main" form and delete the current subform
control from the copy

With the target "main" form in design view and at less than full
screen, select your new "sufForm" and drag it into the desired
location in the target form.

If you got it right to that point then look at the properties of your
subform control and you should see Link Master Field and Link Child
Field each with a field of the same name (or at least the same sense).

HTH
 
I

i_takeuti

Access Beginner said:
I am trying to create a time sheet. We have several projects and under each
project we have multiple tasks. I would like our employees to use the
first
combo box to select the project. With the selected project I would like
our
employees to select only the task related to that project in the second
box.
I have a continous subform. I have tried quries where the project ID is
used
to limit the task, but when I move to the next project the previous task
changes with the new project.

Any suggestions?
 

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