access expression needed

M

MVelocity

I am trying to create an expression for a Yes/no field...when Yes choosen,
then another field for a date is automatically entered with the date the yes
was choosen.

Can you Help?
 
R

Rick Brandt

MVelocity said:
I am trying to create an expression for a Yes/no field...when Yes choosen,
then another field for a date is automatically entered with the date the yes
was choosen.

Can you Help?

Well that wouldn't be an "expression". You would need VBA code in the
AfterUpdate of the Control bound to the Yes/No field (on a form).

If Me!YesNoFieldName = False Then
Me!DateFieldName = Null
Else
Me!DateFieldName = Date()
End If
 
M

MVelocity

I entered it, but I must have something off, I get either a 0 of rno and a -1
for yes?
 
M

MVelocity

I have my yes/no box and I have a date field, I want the date field to be
blank when the box is not check and when I check the box, I want the date
field to be automatically filled with the date that box was checked
 
J

John Spencer

Rick Brandt's code same should do that.

All you need to do is put the code in the after update event of the YesNo
control on a form. You can't do this directly in a table or query.
 
Top