R
Rob S.
I am a college student working on a semester project and I have a form that
is supposed to allow a user to input multiple critera to a query, like
LastName, Date, etc. I've tried it out multiple ways, but I cannot make it
work consistently. Here are my findings:
The query, when blank, runs fine. All records show.
If one form-based criteria is added to the query, (like
[Forms]![SwitchboardStaffStats]![Last_name_control]) and appropriate records
are typed into the FORM, it works properly. If the search box on form is
cleared, and then replaced with another name, it works properly.
If one more form-based criteria is added
([Forms]![SwitchboardStaffStats]![department_control]) And filled in, it is
run. The Query returns nothing.
If the Query is cleared of all criteria (the query and the form are
cleared), and then all three are copied back into the query criteria, the
query runs fine. Until you try to run a second one, with a different number
of criteria. For instance, if you search by date and name it works, but if
you then run a search for name, it does NOT work.
The form-to-query seems to work only ONCE. And then the code to connect
back to the form has to be copied back in for it to work again.
Am I missing something in my macro (which I created through Access)? I am
not familiar with VB, but could anyone provide some insight on how to make
this work?
is supposed to allow a user to input multiple critera to a query, like
LastName, Date, etc. I've tried it out multiple ways, but I cannot make it
work consistently. Here are my findings:
The query, when blank, runs fine. All records show.
If one form-based criteria is added to the query, (like
[Forms]![SwitchboardStaffStats]![Last_name_control]) and appropriate records
are typed into the FORM, it works properly. If the search box on form is
cleared, and then replaced with another name, it works properly.
If one more form-based criteria is added
([Forms]![SwitchboardStaffStats]![department_control]) And filled in, it is
run. The Query returns nothing.
If the Query is cleared of all criteria (the query and the form are
cleared), and then all three are copied back into the query criteria, the
query runs fine. Until you try to run a second one, with a different number
of criteria. For instance, if you search by date and name it works, but if
you then run a search for name, it does NOT work.
The form-to-query seems to work only ONCE. And then the code to connect
back to the form has to be copied back in for it to work again.
Am I missing something in my macro (which I created through Access)? I am
not familiar with VB, but could anyone provide some insight on how to make
this work?