In the table Design View, select the checkbox field. In the Properties box at the bottom of the screen is a property Format. Select Yes/No from the droplist.
#2 What is the event that means the user has indicated "Yes"
The "event" is that the checkbox is "checked". That is, it has a tick displayed.
However, if you mean what value is stored in the table to indicate that the user has checked Yes, it is a value of 1. A value of 0 indicates that the user has not checked the checbox.
thanks , but I got that far. When I am trying to write code that will make certain fields visible only when the box is checked, I don't know the event to put in. This may be really simple, but I am just starting to use VBA.
Can anyone give me an example of code that will make other fields visible/not visible according to whether or not a check box is checked? I have tried everything!
I've got three check boxes in this example ("CourseTitleCheck", "MyCheck" and "DeptCheck"
I have several labels, text boxes, or combo boxes I hide or display, depending on which boxes are checked.
This code is kind of ugly, but it works - should give you enough to go on to make yours work:
Private Sub CourseTitleCheck_Click()
If CourseTitleCheck = -1 Then
DeptCheck = 0
CourseTitle.Visible = True
CourseLabel.Visible = True
EENumber.Visible = False
MyCheck.Visible = False
End If
If CourseTitleCheck = 0 Then
CourseTitle.Visible = False
CourseLabel.Visible = False
EENumber.Visible = True
MyCheck.Visible = True
End If
If DeptCheck = 0 Then
DeptCombo.Visible = False
DeptLabel.Visible = False
End If
If DeptCheck = -1 Then
DeptCombo.Visible = True
DeptLabel.Visible = True
End If
exit sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.