Just need some quick help in clearing up something....
I have a form with the follwing.......
OrderDate
default value =Date()
InvoiceDate
control source =[OrderDate]+2
DayoftheWeek
control source =Weekday([InvoiceDate])
ActualDateofInvoice
control source =IIf([Weekday]=7,[InvoiceDate]+2,[InvoiceDate])
Basically the invoice date is automatically supposed to be 2 days after the order date, but it needs to avoid Saturday and Sunday.
So.... on the DayoftheWeek field it looks at the invoice date and it returns 1, 2, 3, and so on for what day of the week it is.
Then on ActualDateofInvoice it uses an if function that if it is Saturday or day 7, add 2 days to the invoice date and put that in the field.
I want to add another if statement to the control source in ActualDateofInvoice that will also add 1 day for Sunday. Here is what I have tried: =IIf([Weekday]=7,[InvoiceDate]+2,[InvoiceDate]) Or IIf([Weekday]=1,[InvoiceDate]+1,[InvoiceDate])
For some reason the above statement gives me a -1 in all the fields. It works fine until I add the second if statement. What error am I making?
Or do I need a better way to do this?
Thanks!
I have a form with the follwing.......
OrderDate
default value =Date()
InvoiceDate
control source =[OrderDate]+2
DayoftheWeek
control source =Weekday([InvoiceDate])
ActualDateofInvoice
control source =IIf([Weekday]=7,[InvoiceDate]+2,[InvoiceDate])
Basically the invoice date is automatically supposed to be 2 days after the order date, but it needs to avoid Saturday and Sunday.
So.... on the DayoftheWeek field it looks at the invoice date and it returns 1, 2, 3, and so on for what day of the week it is.
Then on ActualDateofInvoice it uses an if function that if it is Saturday or day 7, add 2 days to the invoice date and put that in the field.
I want to add another if statement to the control source in ActualDateofInvoice that will also add 1 day for Sunday. Here is what I have tried: =IIf([Weekday]=7,[InvoiceDate]+2,[InvoiceDate]) Or IIf([Weekday]=1,[InvoiceDate]+1,[InvoiceDate])
For some reason the above statement gives me a -1 in all the fields. It works fine until I add the second if statement. What error am I making?
Or do I need a better way to do this?
Thanks!