trapping errors - is there access equivalent of iserror in excel

grapevine

Registered User.
Local time
Today, 21:49
Joined
Feb 21, 2009
Messages
39
I have the field shown below in a query which is now working properly and correctly putting either Overdue or Not Overdue in a new field. I am then searching on this field to obtain any overdue records. This is all fine.

Reviewdate1: IIf(DateAdd("d",(([courseplannedenddate]-[coursestartdate])/5),[coursestartdate])<=Date(),"overdue","notoverdue")

But, if either the courseplannedenddate or the coursestartdate are empty then the whole query fails (data mismatch). How can I trap the error in Access. If this was a problem in Excel I would use iserror but I have no idea of the syntax to use in Access.

Can you do a nested if in Access?
How can I trap the error?
Or is there a better way of approaching this? Am I thinking too much Excel and not enough Access?
Any assistance greatly appreciated
Marion
 
Could you not use 'Is Null' Or 'Is Not Null' in your query on the date fields!
 
Thank you so much - such a easy solution! I have tested it out and everything works a treat.

Much obliged for your time.
Marion
 
Hi Marion,

I am still very much a novice myself, but to answer your question you can nest IIF statements just by adding multiple IIF statements and it would check the condition of True Or False on each.
 
Thank you for your comment about nested ifs. I had experimented but I could not get the iserror part of the if problem sorted so your first solution was so clean and simple that I used that instead.

Many thanks for your help
 

Users who are viewing this thread

Back
Top Bottom