Yes/No Trouble

  • Thread starter Thread starter Debbie
  • Start date Start date
D

Debbie

I would like my check box in a form for Male/Female to store either "M"
or "F" in the table instead of Yes/No. Is this possible?
 
You could do that with a combo box.

A check box will always have the values -1 (true) or 0 (false). If you are
comfortable writing VBA code, you could be possible to program an unbound
check box to populate a field with M or F, depending in its value, using the
form's Current and Undo events to initialize the check box for the record.
 
Use the Current event of the form to assign True or False to the check box,
depending on the value of the field.

Use the AfterUpdate event procedure of the unbound text box to assign "M" or
"F" to the field, depending on the check box's Value.

Use the Undo event of the form to assign True or False to the check box,
depending on the OldValue of the field.

This approach will not work in a continuous form or datasheet.
 
Debbie said:
Am I asking to much to give me a start with a VBA code?

No code necessary. In your table design change the display control from a
CheckBox to a TextBox and then set the format property to...

;"Male";"Female"

With a format sequence using three semi-colons as above you can specify any text
for a YesNo field.
 
Thank you. It now works, I don't have check boxes but that is Okay.
Thank you, have a Merry Christmas!
 
Back
Top