access expression needed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
I entered it, but I must have something off, I get either a 0 of rno and a -1
for yes?
 
True is -1 in Access and False is 0.

What do you want to do with the value?
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Auto Populate 4
Help with Query 2
How do I get average days to fill? 2
Auto populating in a table 2
Calendar Control in UserForm 1
MS Access problem 0
Form Autofit facility in Form wizard!! 1
=PRODUCT 6

Back
Top