IIf statement using a check box

Bpgasguy

New member
Local time
Today, 11:03
Joined
Apr 26, 2014
Messages
3
I have a query that sometimes need to have last weeks Data versus this weeks data So I put a check box on my reports menu and made this IIf Statement


IIf([Forms]![ReportsMenu]![Chkwk]=False,Between DateAdd("d",-6-Weekday(Date(),2),Date()) And DateAdd("d",-Weekday(Date(),2),Date()),Between DateAdd("d",+1-Weekday(Date(),2),Date()) And DateAdd("d",+7-Weekday(Date(),2),Date()))

And obviously it doesn't work. It won't display anything. I can do it with either statements the true or false but doesn't work with the iif statement

Thanks for your help
 
I can do it with either statements the true or false but doesn't work with the iif statement
Can you show us the statements that do work
 
Between DateAdd("d",-6-Weekday(Date(),2),Date()) And DateAdd("d",-Weekday(Date(),2),Date())

Between DateAdd("d",+1-Weekday(Date(),2),Date()) And DateAdd("d",+7-Weekday(Date(),2),Date()))

They both will work just not in the iif statement
 
I think that you might just be missing a closing bracket for the IIF() function, so try:
IIf([Forms]![ReportsMenu]![Chkwk]=False, Between DateAdd("d",-6-Weekday(Date(),2),Date()) And DateAdd("d",-Weekday(Date(),2),Date()) , Between DateAdd("d",+1-Weekday(Date(),2),Date()) And DateAdd("d",+7-Weekday(Date(),2),Date())))
 

Users who are viewing this thread

Back
Top Bottom