Using two drop downs to filter a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I may have asked this before, but I need to have two drop downs filter a
form. I have the Analyst_Name box, and the Week_Ending box. They can filter
individually okay, but I need them to be able to filter jointly so it filters
down to the one record of an analyst for a specific week. I tried this string
to get the response:
stLinkCriteria = "[Analyst_Name Field]=" & "'" & Me![Combo80] & "'" And
"[Week_Ending Field]=" & "#" & Me![Combo92] & "#"

but this gives me a "Type Mismatch" error. How do I do this?

Thanks in advance
 
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

That assuming that Week_Ending Field is date field and Analyst_Name Field
is string
Just incase they are not, then
For string you need a single quote before and after
For Date # before and after
For number none
 
Ofer,
This came up with syntax error:
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

So I added the closing quote between combo80 & "'" AND

and it still comes back with type mismatch


--
Chris Freeman
IT Project Coordinator


Ofer said:
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

That assuming that Week_Ending Field is date field and Analyst_Name Field
is string
Just incase they are not, then
For string you need a single quote before and after
For Date # before and after
For number none

--
I hope that helped
Good luck


Chris Freeman said:
I may have asked this before, but I need to have two drop downs filter a
form. I have the Analyst_Name box, and the Week_Ending box. They can filter
individually okay, but I need them to be able to filter jointly so it filters
down to the one record of an analyst for a specific week. I tried this string
to get the response:
stLinkCriteria = "[Analyst_Name Field]=" & "'" & Me![Combo80] & "'" And
"[Week_Ending Field]=" & "#" & Me![Combo92] & "#"

but this gives me a "Type Mismatch" error. How do I do this?

Thanks in advance
 
What is the field type of [Week_Ending Field] and [Analyst_Name Field]
And does Me![Combo80] and Me![Combo92] returns any value
--
I hope that helped
Good luck


Chris Freeman said:
Ofer,
This came up with syntax error:
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

So I added the closing quote between combo80 & "'" AND

and it still comes back with type mismatch


--
Chris Freeman
IT Project Coordinator


Ofer said:
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

That assuming that Week_Ending Field is date field and Analyst_Name Field
is string
Just incase they are not, then
For string you need a single quote before and after
For Date # before and after
For number none

--
I hope that helped
Good luck


Chris Freeman said:
I may have asked this before, but I need to have two drop downs filter a
form. I have the Analyst_Name box, and the Week_Ending box. They can filter
individually okay, but I need them to be able to filter jointly so it filters
down to the one record of an analyst for a specific week. I tried this string
to get the response:
stLinkCriteria = "[Analyst_Name Field]=" & "'" & Me![Combo80] & "'" And
"[Week_Ending Field]=" & "#" & Me![Combo92] & "#"

but this gives me a "Type Mismatch" error. How do I do this?

Thanks in advance
 
Ofer,
Field type for week ending is date, analyst name is text. The two work on
the form independent of one another, so if I filter for the name, it filters
the name, and so on with the date, but I can't get them to filter togethr so
I can tretunr a single name on a single date. I've done this before but for
some reason it just doesn't seem to work now.
--
Chris Freeman
IT Project Coordinator


Ofer said:
What is the field type of [Week_Ending Field] and [Analyst_Name Field]
And does Me![Combo80] and Me![Combo92] returns any value
--
I hope that helped
Good luck


Chris Freeman said:
Ofer,
This came up with syntax error:
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

So I added the closing quote between combo80 & "'" AND

and it still comes back with type mismatch


--
Chris Freeman
IT Project Coordinator


Ofer said:
stLinkCriteria = "[Analyst_Name Field]='" & Me![Combo80] & "' And
[Week_Ending Field]=#" & Me![Combo92] & "#"

That assuming that Week_Ending Field is date field and Analyst_Name Field
is string
Just incase they are not, then
For string you need a single quote before and after
For Date # before and after
For number none

--
I hope that helped
Good luck


:

I may have asked this before, but I need to have two drop downs filter a
form. I have the Analyst_Name box, and the Week_Ending box. They can filter
individually okay, but I need them to be able to filter jointly so it filters
down to the one record of an analyst for a specific week. I tried this string
to get the response:
stLinkCriteria = "[Analyst_Name Field]=" & "'" & Me![Combo80] & "'" And
"[Week_Ending Field]=" & "#" & Me![Combo92] & "#"

but this gives me a "Type Mismatch" error. How do I do this?

Thanks in advance
 
Back
Top