How do you eliminate errors

G

GregS

Hi, I'm building a database and I'm getting lots of errors where their is
missing data. Can someone tell me how to get rid of these? I'm presuming
there's something you can do like in Excel - like 'ISERROR' or something
similar

Thanks very much

Greg
 
P

Piers 2k

When do you get your errors, and what do you want to do about them? Form
validation?

Need some more info...

Piers
 
A

Alex White MCDBA MCSE

Write a validation routine that checks the data,

** below is air code totally untested **


dim adoTest as new adodb.recordset
with adoTest
.open "Select * from
TblTest",currentproject.connection,adopenkeyset,adopendynamic
do while not .eof
' process your record
'to check for valid dates
if isdate(.fields("myDate").value) then
' this is a valid date
else
' date is invalid
end if

'to check for valid numbers
if isnumeric(.fields("myNumber").value) then
' this is a valid number
else
' number is invalid
end if

'to check for length of strings
if len(trim(.fields("myString").value))>5 then
' this string is longer than 5 chars long
else
' this string is 5 or less chars long
end if
.movenext
loop
.close
end with

*** Finish ***

this will help you process your data, you will need to change the
table/fields names to reflect your specific names, where you have errors you
may want to update the values with a default value.


--

Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
G

Gregs

Hi Piers

I'd like to return a blank entry if possible, if not 'N/A' will do.

does that help?
 
Top