data mismatch problem

  • Thread starter Thread starter Tcs
  • Start date Start date
T

Tcs

I have a set of records where some are missing a street number in a particular
[numeric] column/field. *Some* of these records do contain the street number in
the first 4 character positions of another [text] column.

I've been thru the help doc, *several* times, but I'm just not seeing it...

How do I set the value of a numeric field to the numeric value of the string
field? I'm thinking:

strNmbr = SomeFunction(left$(4, [MailingAddress]))

I appreciate the assist, thanks in advance,

Tom
(Access 2k)
 
You've got your arguments backwords in the call to the Left$ function. Try

strNmbr = SomeFunction(Left$([MailingAddress], 4))

BTW, that will fail if the MailingAddress field is Null. To avoid that
problem, remove the $ from the end of Left$.
 
Well...dang. I've used this before. I know better. DUH! What *was* I
thinking?! And with that fix I didn't need the "SomeFunction" either.

Thanks a lot.
 
In addition to Douglas' reply, the function you use will depend on the data
type of the receiving field. If it is an Integer, use CInt(), for Long it is
CLng(), etc.
 
Back
Top