CheckBox within a frame

  • Thread starter Thread starter ArneGolf
  • Start date Start date
A

ArneGolf

I have some checkboxes grouped within a frame so once I select one, put a
check in the box, I have to have one of the boxes checked. Is there a way to
allow all boxes to be unchecked once one has been checked?
 
The Option Group has a value property. You can use code to set the value to
something that isn't one of the option values. You could try Null or a large
number.
 
Assuming your frame is named "fraYourFrameName", you can select it in design
view and open its properties. Find the "On Dbl Click..." property and change
it to [Event Procedure]. Click the [...] button on the right to open the code
window and make sure your code looks something like the following:

Private Sub fraYourFrameName_DblClick(Cancel As Integer)
Me.fraYourFrameName.Value = Null
End Sub

Double-clicking the frame in form view will now un-select all options. They
will all appear with grayishness in the option buttons.
 
I tried adding the code but it still will not let me unselect both boxes.
This is all the code when I open Code Builder. Maybe someone can tell me what
is wrong:
Private Sub cmdResetStock_Click()
Stock.Value = 0
fraStocks.DefaultValue = ""
End Sub

Private Sub Form_Activate()

End Sub

Private Sub Form_DblClick(Cancel As Integer)

End Sub

Private Sub Form_load()
Form.TimerInterval = 1000
End Sub

'Private Sub Form_Timer()
' lblDateAndTime.Caption = vbCrLf & Format(Now(), "long date") & _
' vbCrLf & vbCrLf & Format(Now(), "long time")
'End Sub


Private Sub Command175_Click()
On Error GoTo Err_Command175_Click

Dim stDocName As String

stDocName = "Billing"
DoCmd.OpenReport stDocName, acPreview

Exit_Command175_Click:
Exit Sub

Err_Command175_Click:
MsgBox Err.Description
Resume Exit_Command175_Click

End Sub
Private Sub Billing_Report_Click()
On Error GoTo Err_Billing_Report_Click

Dim stDocName As String

stDocName = "Billing"
DoCmd.OpenReport stDocName, acPreview

Exit_Billing_Report_Click:
Exit Sub

Err_Billing_Report_Click:
MsgBox Err.Description
Resume Exit_Billing_Report_Click

End Sub

Private Sub fraCartShed_DblClick(Cancel As Integer)
Me.fraCartShed.Value = Null
End Sub


Private Sub Mailing_Labels_Click()
On Error GoTo Err_Mailing_Labels_Click

Dim stDocName As String

stDocName = "Labels Membership Purchase"
DoCmd.OpenReport stDocName, acPreview

Exit_Mailing_Labels_Click:
Exit Sub

Err_Mailing_Labels_Click:
MsgBox Err.Description
Resume Exit_Mailing_Labels_Click

End Sub
Private Sub Advanced_Search_Click()
On Error GoTo Err_Advanced_Search_Click


Screen.PreviousControl.SetFocus
DoCmd.RunCommand acCmdFind

Exit_Advanced_Search_Click:
Exit Sub

Err_Advanced_Search_Click:
MsgBox Err.Description
Resume Exit_Advanced_Search_Click

End Sub
Private Sub Cart_Sheds_Alphabetical_Click()
On Error GoTo Err_Cart_Sheds_Alphabetical_Click

Dim stDocName As String

stDocName = "Cart Sheds Alphabetical"
DoCmd.OpenReport stDocName, acPreview

Exit_Cart_Sheds_Alphabetical_Click:
Exit Sub

Err_Cart_Sheds_Alphabetical_Click:
MsgBox Err.Description
Resume Exit_Cart_Sheds_Alphabetical_Click

End Sub
Private Sub Cart_Sheds_Numerical_Click()
On Error GoTo Err_Cart_Sheds_Numerical_Click

Dim stDocName As String

stDocName = "Cart Sheds Numerical"
DoCmd.OpenReport stDocName, acPreview

Exit_Cart_Sheds_Numerical_Click:
Exit Sub

Err_Cart_Sheds_Numerical_Click:
MsgBox Err.Description
Resume Exit_Cart_Sheds_Numerical_Click

End Sub


Duane Hookom said:
Assuming your frame is named "fraYourFrameName", you can select it in design
view and open its properties. Find the "On Dbl Click..." property and change
it to [Event Procedure]. Click the [...] button on the right to open the code
window and make sure your code looks something like the following:

Private Sub fraYourFrameName_DblClick(Cancel As Integer)
Me.fraYourFrameName.Value = Null
End Sub

Double-clicking the frame in form view will now un-select all options. They
will all appear with grayishness in the option buttons.

--
Duane Hookom
Microsoft Access MVP


ArneGolf said:
I am too new at this and am not sure how or where to do that.
 
Got it. Had a misspelling in the frame name. Thanks

Duane Hookom said:
Assuming your frame is named "fraYourFrameName", you can select it in design
view and open its properties. Find the "On Dbl Click..." property and change
it to [Event Procedure]. Click the [...] button on the right to open the code
window and make sure your code looks something like the following:

Private Sub fraYourFrameName_DblClick(Cancel As Integer)
Me.fraYourFrameName.Value = Null
End Sub

Double-clicking the frame in form view will now un-select all options. They
will all appear with grayishness in the option buttons.

--
Duane Hookom
Microsoft Access MVP


ArneGolf said:
I am too new at this and am not sure how or where to do that.
 
Back
Top