copy data to new record

K

Karen Skipper

I've been working on this code and now get an error saying " invalid use of
null". How do I handle null fields (they are okay in what I'm doing)?
Sample of code below:

'save data in fields
emailvar = Me!
extvar = Me![EXTENTION]
phonevar = Me![PHONE]
faxvar = Me![FAX]
origvar = Me![originator]

'code in here to append a new record to the table

'copy data in fields
Me![EMAIL] = emailvar
Me![EXTENTION] = extvar
Me![PHONE] = phonevar
Me![FAX] = faxvar
Me![originator] = origvar


Any help?

Karen
 
K

Karen Skipper

Thanks, That seems to fix the problem.

FYI-
I also found that I have to have the docmd.Echo true (there is a docmd.echo
false at the beginning of the code) after the section that fills in the new
fields or some of them appear to be empty until I move to the previous
record and back to the new one. I had it in the section where the new
record is appended. I'm not sure that even helps keep the user from seeing
the form change and the fields get filled in.

Karen


Larry Daugherty said:
 
Top