You cannot check for NULLs that way. In fact, if you try If NULL = NULL then,
the condition will *always* be False!!
Try this:
if Not IsNull(Me.[combobox]) then
me.[textbox].value = now()
me.[checkbox] = TRUE ' not "Yes"
end if
HTH

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> Hi all,
>
[quoted text clipped - 16 lines]
>
> Please help. Thanks.
Please Help - 29 Jun 2007 18:30 GMT
Hi SteveS,
Thanks for your help. It does not seem to be working.
When I have my cursor in the combo box field (before even selecting a
value), today's date automatically populates in the text box and a check also
automatically populates in the check box. If I select a value and then
remove it, both text and check box won't remove the date and check,
respectively.
My combo box displays a name on the form but populates an ID (numeric data
type) of that name in the table.
I inserted your code in the BeforeUpdate of the combo box. Did I do
something wrong?
Thanks.
> You cannot check for NULLs that way. In fact, if you try If NULL = NULL then,
> the condition will *always* be False!!
[quoted text clipped - 28 lines]
> >
> > Please help. Thanks.
SteveS - 29 Jun 2007 20:22 GMT
You don't have code to remove the values in the controls.
I would probably have the code in the combo box after update event.
Try this:
If IsNull(Me.[combobox]) then
Me.[textbox] = NULL
Me.[checkbox] = FALSE
Else
Me.[textbox] = now()
Me.[checkbox] = TRUE
End If
HTH

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> Hi SteveS,
>
[quoted text clipped - 46 lines]
> > >
> > > Please help. Thanks.
Please Help - 29 Jun 2007 21:06 GMT
Hi SteveS,
Thanks again for your helps. For some reason, it only records the checkbox
in the table. The combo box and the text field values are not recorded in
the table.
Do you know why?
Thanks.
> You don't have code to remove the values in the controls.
>
[quoted text clipped - 62 lines]
> > > >
> > > > Please help. Thanks.
Please Help - 29 Jun 2007 21:48 GMT
SteveS,
I want to thank you again for your helps. Please ignore my previous
message. I forgot that I had a query set up to erase both combo box and text
field in the table.
You code works perfectly.
Thanks again. Have a nice weekend.
> You don't have code to remove the values in the controls.
>
[quoted text clipped - 62 lines]
> > > >
> > > > Please help. Thanks.