Numeric Field Overflow

E

Edward Lollar

Hi, All . . .

I'm very well versed in Access VBA, but I have one small question. I've written some code to validate a semi-colon delimited file where the code loops through each field and verifies that there is good data present before an import is made within the program. I've managed to capture what I believe to be all of our basic types of errors but one--Numeric Field Overflow.

My question is how do I trap for this error? I can't use rst.Fields.Value as my basis for the trap because there is no value here to validate. Any other suggestions?

BTW: This code is currently written in Access 97

Thanks in advance.


*********************************************

Edward Lollar
Programmer / Analyst

Mississippi State Tax Commission
Office of Information Technologies
Bureau of Infrastructure and Support
Special Application Development & Support
 
J

John Nurick

Hi Edward,

I'd probably do what I think you're trying to do by reading the text
file line by line and splitting it on the delimiters to get an array
containing the string representation of each field in the record. I'd
then write code to walk through the array applying the appropriate tests
to the data.

For instance, for an Integer field I'd use something like

varDummy = CInt(strFieldValue)

then trap the various errors and apply any other tests (eg. value must
be between 0 and 9).

Working at the textfile level like this means you are workign with the
actual data.

Hi, All . . .

I'm very well versed in Access VBA, but I have one small question. I've
written some code to validate a semi-colon delimited file where the code
loops through each field and verifies that there is good data present
before an import is made within the program. I've managed to capture
what I believe to be all of our basic types of errors but one--Numeric
Field Overflow.
 
G

Guest

Don't know if this will be usefull to you.I have found the same problem in one of my applications.
I imported a text file named Test.123. Macro kept giving me "numeric field overflow" msg.
Then changed the ".123" to ".txt" with .bat command and it worked!

Try and let me know if it worked,sure like to know if it's coincidence or not.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top