Once I get this working, I have another question. Once the
Owner, and the Task have been selected, I need to run a
query that will take our owner (Joyce) and the task
they've selected (Update) and read another table that has
multiple records with "Update" as the common task. This
could be hundreds of records, so I cannot use the form to
show these. Is there an way to write one query that will
recognize the Owner and the task and only pull in the
appropriate records from a third table, named "Required"?
Thanks for your continued help.
-----Original Message-----
Oops, I think I can add a little more.....
view' or 'Create table by using wizard'. The field is an
autonumber primary key for the table. (This question is
sorta scary - you don't know how to build a table? If
not, I'm afraid I couldn't detail all of the steps very
well. Besides, there are several books available that
would do a better job than I could do. And don't forget
about the Access help off-line and on-line resources.)1, Linda = 2, Susan = 3. When the first combo
selects "Joyce", the ID is 1. The second combo uses '1'
as the filter criteria. There is no need for three
queries when you use the code provided.
Not code exactly, but SQL. In the row source property of
the second combo, paste the following:
SELECT tblTaskAssignments.AssignID,
tblTaskAssignments.TaskID, tblTaskAssignments.NameID
FROM tblTaskAssignments
WHERE (((tblTaskAssignments.NameID)=[Forms]![frmMyForm]!
[cboName]));
(Of course, if your table names, field names, form names,
control names are different, then you must change this SQL
to reflect your names.)Event tab, in the list of events find "After Update",
click in the field and a drop-down arrow appears. From
the drop-down list select [Event Procedure]. Then click
the elipsis (...) to the right of the field. This will
open VBA and that is where the code goes. Here is the
code:
Private Sub cboName_AfterUpdate()
Me.cboTask.Requery
End Sub
Thanks for the help.
You're welcome.
-----Original Message-----
The record source for the second combo should be a query
that is filtered by the value in the first combo. In the
After_Update event of the first combo, requery the second
combo.
tblNames
NameID
tblTasks
TaskID
tblTaskAssignments
AssignID
TaskID
NameID
cboName
record source = tblNames
After Update event code:
Private Sub cboName_AfterUpdate()
Me.cboTask.Requery
End Sub
cboTask
record source =
SELECT tblTaskAssignments.AssignID,
tblTaskAssignments.TaskID, tblTaskAssignments.NameID
FROM tblTaskAssignments
WHERE (((tblTaskAssignments.NameID)=[Forms]! [frmMyForm]!
[cboName]));
If this isn't enough information/direction to help you,
then you'll need to post specifics about the related
tables, fields, and control names.
--
rpw
:
I have a form that contains two combo boxes. My plan
is
that the first combo box will select a name, and then
the
second combo box would only contain the specific tasks
that correspond with the name selected in box one (it
currently contains all the tasks for all the names in
combo box 1). I think I have to adjust either the
control
source or the after update field, but I am unsure how
to
accomplish the goal. Any suggestions?
.
.