Hi
I am doing my AS Level ICT coursework and am required to create a library system. The system needs to be able to automatically calculate a return date for a book 14 days after the date it was loaned out.
However, the system also needs to take into account school holidays; if the return date for a book is during a school holiday then the return date becomes the first monday after the holiday.
I have been trying to create a macro in Visual Basic using an iif function to do this. Here is what I've got so far:
iif([Due Date]=25/10/11,"1/11/10",iif([Due Date]=26/10/10,"1/11/10",iif([Due Date]=27/10/10,"1/11/10",iif([Due Date]=28/10/10,"1/11/10",iif([Due Date]=29/10/10,"1/11/10",iif([Due Date]=30/10/10,"1/11/10",iif ([Due Date]=31/10/10,"1/11/10", =DateAdd("d",14,[Loan Date])))))))
("1/11/10" is the first monday after the holiday, all other dates are from during the holiday itself. The false value is the Date Add function to add 14 days on as normal.)
Visual Basic didnt like my use of greater and less than functions so I have had to list each date separately and create a nested iif function.
I don't know whether this is correct (I have little knowledge of Visual Basic) but I keep getting a compile error message saying "Expected =". I have no idea what this means.
Any help would be greatly appreciated.
Thanks
cs93