error- please help!

DK8

Registered User.
Local time
Today, 12:09
Joined
Apr 19, 2007
Messages
72
I am getting an error message that reads: Error converting data type varchar to smalldatetime. (Microsoft OLE DB Provider for SQL Server. This appears to be happening in the Employee SSN (Social Security Number) field of a form. Can someone shed some light on why I am getting this error? Thanks.
 
Well the basics of this error is saying you have a character field (varchar) and you are trying to put it in a field defined as smalldatetime. And the data it is trying to convert is not valid for the smalldatetime datatype.
Basically you have an error in something you are doing. Either mismatched datatypes or moving a field to the wrong place.
 
Ok, can you give me an idea as to how you would proceed to determine the source of the error and correct it? I'm new to programming in VBA. thanks,
 
If you aren't getting the Debug dialog (the one that asks if you want to debug) you should temporarily comment out your On Error GoTo code so that it will generate that dialog, then you can click Debug and it should take you to the location which is causing the problem.
 
Should on error go to code be writtten into every function or at what level? I haven't noticed them in every function at the module level and wonder if they should be there? Thank you in advance to anyone who can help out.
 
Pretty much you want to put one on functions and subs in standard modules and on events in form modules where the possibility of an error occuring is potentially there. So, do you need one for everything? No, you don't. Things like DoCmd.Quit, etc. wouldn't need one. But, if you are running queries, updating forms, etc. then you would want one.
 
Thank you again!

This forum is great, with some terrific resources.
 

Users who are viewing this thread

Back
Top Bottom