Can someone help me with this funny problem?
I just created a custom criteria form that a user enters data to open a report.
.
I have two unbound check boxes namely 1. chkshowcredits and 2. chknocredits that a user must select/tick one of them before opening the report.
The on click event (code) of the OK button on the form to preview the report is below:
Rest of the validation in the code above is fine but the error message occurs exactly at code line#10 and could possibly occur again at line#12, i.e when I debug it. An this is to do with the two unbound check boxes.
What is the problem.? I just want the user to tick one of the check boxes to open a particular report based on the check box ticked.
I am I wrong somewhere.?
Can one smart person help me out here. I tried to solve this but its hurting my brain.
Thanks..
I just created a custom criteria form that a user enters data to open a report.
.
I have two unbound check boxes namely 1. chkshowcredits and 2. chknocredits that a user must select/tick one of them before opening the report.
The on click event (code) of the OK button on the form to preview the report is below:
Code:
Private Sub Command6_Click() If IsNull(Me.Oyear) = True Or IsNull(Me.ndate) = True Then MsgBox "One of the required dates is missing", vbCritical + vbOKOnly, "Date Error" End If If Me.Oyear <= Me.ndate Then MsgBox "Oldest date must be less than Newst date", vbCritical + vbOKOnly, "Date Error" Exit Sub End If [B]If me.chkshowcredits.Value = True Then[/B]'error occurs here DoCmd.OpenReport "Summary with Credits", acViewPreview [B]ElseIf me.chknocredits.Value = True Then[/B]'error occurs here DoCmd.OpenReport "Summary With No Credits", acViewPreview Else MsgBox "Select an option to show or not to show credits in the report", vbCritical + vbOKOnly, "Data Missing" End If End Sub
What is the problem.? I just want the user to tick one of the check boxes to open a particular report based on the check box ticked.
I am I wrong somewhere.?
Can one smart person help me out here. I tried to solve this but its hurting my brain.
Thanks..
Comment