shabbaranks
Registered User.
- Local time
- Today, 01:38
- Joined
- Oct 17, 2011
- Messages
- 300
Hi all..
Im trying to get my code so that when a button is pressed it will tick a checkbox which runs some code to display table values in a combo box. And then if its pressed again it reverts to the original options as per below:
So based on if the checkbox is ticked the relevant code should run. At the moment Im getting a blank combo box - any ideas why?
Thanks
Im trying to get my code so that when a button is pressed it will tick a checkbox which runs some code to display table values in a combo box. And then if its pressed again it reverts to the original options as per below:
Code:
Private Sub MinutesCheck_Click()
Dim strSQL As String
If Me.MinutesCheck = True Then
strSQL = "SELECT MinutesTable.MinutesInWords, MinutesTable.MinutesInFractions " & _
"FROM MinutesTable;"
Me.MinutesCombo.RowSourceType = "table/query"
Me.MinutesCombo.RowSource = strSQL
ElseIf Me.MinutesCheck = False Then
strSQL = "SELECT MinutesTable.MinutesInWords, MinutesTable.MinutesInFractions " & _
"FROM NegativeMinutesTable;"
End If
Me.MinutesCombo.Requery
End Sub
Code:
Private Sub NegativeMinutes_btn_Click()
If Me.MinutesCheck = False Then
Me.MinutesCheck = True
ElseIf Me.MinutesCheck = True Then
Me.MinutesCheck = False
End If
End Sub
So based on if the checkbox is ticked the relevant code should run. At the moment Im getting a blank combo box - any ideas why?
Thanks