Onclick to open report and filter

james_halliwell

Registered User.
Local time
Today, 11:40
Joined
Feb 13, 2009
Messages
211
Hi All,

Please can someone help me out, I have a macro that when someone click on the text in a subfrom it opens a report but filters it to some criteria from the select line, the reeoe I get is Data Type mismatch in criteria expression? When I take out the Request Date it works but I need to filter it by date two!

The macro is an OpenReport,
Where conditions,
="[APO Location]= '" & [APO Location] & "' AND [Request Date]= '" & [Request Date] & "' AND [Product] = '" & [Product] & "'"

Error displayed on action failed
Macro Name:
FrmR1Exceptionssubform : Logical Test : OnClick : Embedded Macro
Condition
True: Not IsNull([Product])
Action Name:
OpenReport
Arguments:
RptRPurchaseOrders, 5, , [APO Location]= 'BE10' AND [Request Date]= '08/03/2013' AND [Product] = '121711
Error 2950

Any one have any idea?
 
Try changing the line to:

="[APO Location]= '" & [APO Location] & "' AND [Request Date]= #" & [Request Date] & "# AND [Product] = '" & [Product] & "'"

When referring to date fields you use pound signs #02/02/2013# to surround the date and you used '02/02/2013' single quotes.
 
Try changing the line to:

="[APO Location]= '" & [APO Location] & "' AND [Request Date]= #" & [Request Date] & "# AND [Product] = '" & [Product] & "'"

When referring to date fields you use pound signs #02/02/2013# to surround the date and you used '02/02/2013' single quotes.


Holly hell it worked!!!!!!!!

many thankss for taking the time to read my post and help me out

many thanks
 

Users who are viewing this thread

Back
Top Bottom