Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter string formatting help

Status
Not open for further replies.

BDCarrillo

Technical User
Jul 9, 2010
30
US
TM and TY are temporary strings pulling a formatted Month and Year from hidden columns on a combo box.

Filtering the year OR month only works just fine, but the string below with "AND" throws a runtime error 13 type mismatch.


Code:
strWhere = "Month([Expense_Date])=" & TM
'^ Works fine
strWhere = "Year([Expense_Date])=" & TY
'^ Works fine
strWhere = "Month([Expense_Date])=" & TM And "Year([Expense_Date])=" & TY
'^ Throws runtime error 13 type mismatch

I just need help formatting this filter to work right with both Month and Year
 
strWhere = "Month([Expense_Date])=" & TM & " And Year([Expense_Date])=" & TY

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
One & " short of success... thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top