Explain a yes/no check

R

R. McMichael

I have a yes/no field. When YES is marked, I want to force and explanation.
How do I do this?
 
A

Al Campagna

McMichael,
A bit more information about your check field, and the
"explanantion" you want to update would have been useful.
Sounds like you want to "force an explanation."

Given a Boolean bound check control (ex. name chkTrueFalse)
with a label (ex. name lblTrueFalse)
Use the AfterUpdate of your checkbox (ex. name lblTrueFalse)

Private Sub chkTrueFalse_AfterUpdate()
If chkTrueFalse = True Then
lblTrueFalse.caption = "True"
Else
lblTrueFalse.caption = "False"
End if
End Sub

You'll also need to add this same code to the form's OnCurrent Event,
so the label will change (appropriately) as you browse from
on record to another.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

Jeff Boyce

If, by "force an explanation", you mean require the user to add an
explanation in a text control near the checkbox, you might use something
like (untested -- substitute your own control names):

If Me!chkYourCheckbox = True Then
Me!txtYourExplanation.Enabled = True
Elseif Me!chkYourCheckbox = False Then
Me!txtYourExplanation = Null
Me!txtYourExplanation.Enabled = False
End If

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Top