I would like to use check box in my form and when you click i need one command to happen and if you dont click it i need another command to happen. i tried using checkbox.value but i am getting error saying Method or data member not found. please help me with right syntax. Colored code is where i declare check box
Private Sub btnRefine_Click()
Dim i As Int
Dim strTemp As String
Dim strFil As String
Dim strM As String
Dim str As String
strM = Me.txtMoiLevel.Value
str = Me.hInpChk.Value
strFil = "ExptlNber IN ('" & Me.txtHyb & "','" & Me.txtSur & "') OR " & _
"(Sur = '" & Me.txtSur & _
"' AND ComN IN (" & str & ")" & _
" AND Moi Between -" & strM & " And " & strM & ")"
If Me.lstChk.ItemsSelected.Count > 0 Then
strTemp = "("
For i = 0 To Me.lstChk.ListCount - 1
If Not lstChk.Selected(i) Then
strTemp = strTemp & "'" & Me.lstChck.Column(0, i) & "',"
End If
Next i
strFil = strFil & " AND ComN IN " & Left(strTemp, Len(strTemp) - 1) & ")"
End If
If Me.CheckPed.ControlType = vbChecked Then
DoCmd.OpenReport "rptPer_Refine", acViewPreview, , strFil, acWindowNormal
Else
DoCmd.OpenReport "rptPerf", acViewPreview, , strFil, acWindowNormal
End If
DoCmd.Maximize
DoCmd.Close acForm, Me.Name
End Sub