I couldn't get that to work [opening the dialog form from the Combo Box] so
I
tried it from a different angle. From the Main Menu, the user makes a
selection which takes them to:
dfrmSelectAnInstructor
When this form opens, they choose an Instructor from the drop down list
and
click OK. The name chosen is given the value "vInstructor".
When the form opens up, all classes are listed, however, once the user
clicks on the Combo Box drop down, the only choices are those classes
where
the Instructor equals vInstructor. This is exactly what I wanted, but
there's
still one other minor problem.
Everything as described above works, however, I would like to filter the
form BEFORE the user clicks on the Combo Box drop down. When a user
selects
an Instructor on "dfrmSelectAnInstructor", that brings them to the One to
Many form showing classes and the students registered for each class, I
would
like to open the form filtered by the Instructor's class. In other words,
the
Instructor will only see their classes.
I'm sure this is possible, but I've never done this before so i obviously
need help. Yes I'm proud of what I accomplished but this would be a nice
finishing touch.
Thanks,
Robert
Robert T said:
Jeff:
Update
--------
I liked your idea of filtering the choices so I changed the Combo Box
query
by adding a parameter for the Instructor. When the user clicks on the
combo
box, they type their name in the parameter box and then they see only
their
classes. That works as designed.
Altough that's a big improvement, I have a better idea. Obviously with a
parameter box, users have to manually type their last name correctly and
that's prone to errors. So I created a form called
"dfrmSelectAnInstructor"
which has it's own combo box which is a drop down list with all of the
instructor names. With this form, we don't have to worry about spelling
errors and the user doesn't have to type anything, they simply select
their
name from a drop down list.
Well the above sounds good, but I'm doing something wrong so I would
definitely appreciate step by step help.
Thanks,
Robert
:
Hi Jeff:
I like the idea of entering a Starting Date, but I love the idea of
filtering the combo box so the instructor sees only his/her classes.
How can
I limit the classes in the combo box to one instructor?
Thanks,
Robert
:
Robert
I suppose one approach might be to add a control alongside the
combobox.
That control would be for a start-checking-on-date.
In the AfterUpdate event for that textbox, you could re-query the
combobox,
which would use a query involving the form's textbox as a selection
criterion. The trick would be to handle "All" dates, but perhaps
your users
could just get used to entering a 'start date' before listing.
If you have instructors who's classes you want to be able to go back
to,
what about the idea of including a combobox to select the instructor
and
limit the existing combobox to display only that instructor's
classes?
Good luck!
Regards
Jeff Boyce
Microsoft Office/Access MVP
We have a One to Many form that displays all of our classes in the
one
portion and every student registered for each class in the subform.
There is a combo box on the form that works very well, but contains
too
many
choices for my supervisor. When the user clicks on the combo box,
it runs
a
query that displays all scheduled classes in the future, plus all
classes
that were completed within the last 90 days. In other words, all
classes
greater than 90 days ago.
That's too many classes for my supervisor who wants the ability to
enter a
starting/ending date so she can restrict the combo box results to
let's
say
February 1, 2008 to March 3, 2008.
Please note that we must keep the ability to go back 90 days to
edit class
information. Very often instructors forget to update their classes
and
must
go back at a later date.
Any suggestions and/or tips on how to do this?
Thanks,
Robert