Issue 9 - 15 Sep 2010 Go Back

DateAdd() - Type Mismatch Error

I was developing a job scheduling database using MS Access. This system works extensively with dates. Everything was working but suddenly the system started to display an error in the module which worked fine before. The error was "data type mismatch in criteria expression". I spent a few hours trying to solve the problem, going through various forums and articles on the Internet. Nothing helped. The next step for me to pinpoint the problem was going through the code and see which section caused the problem. An interesting thing I've noticed that it was the only form where the function DateAdd caused the error. All other forms worked fine. It gave me a clue that it is related to the form record source. So playing with the data I realised that the problem was caused by having a field named DateAdd in the linked table. Once I renamed the field it all worked beautifully. I knew that I should not use system names but somehow it skipped my mind this time. I learned my lesson again.

 

 

 

 

 

 

 

 

 


© 2011 E-SIGHT PTY.LTD. Mentone Vic 3194 Melbourne                   :: DateAdd() - Type Mismatch Error :: |    Home    |    Contact Us    |    Sitemap    |