Hello,
The following code supposed to let me print all records OR only those where dAreaFK = myCBO
currently I get an error message "Object missing"
if i remove this:
Or Me!cboStatsArea Is Null
from the last line the it works but only if i make selection in combo.
Can you advice please
Thank you
The following code supposed to let me print all records OR only those where dAreaFK = myCBO
currently I get an error message "Object missing"
if i remove this:
Or Me!cboStatsArea Is Null
from the last line the it works but only if i make selection in combo.
Code:
Private Sub cmdPrintOpen_Click()
'Print open defects using R_Open_details
Dim i As Integer
i = DCount("*", "Q_Open_details", "dAreaFK=cboStatsArea OR cboStatsArea IS Null")
'MsgBox "The count of rows is " & i
If i = 0 Then
MsgBox "No Records available for print", _
vbOKOnly, "Error"
Exit Sub
End If
DoCmd.OpenReport "R_Open_details", acPreview, , _
"dAreaFK=" & Me!cboStatsArea Or Me!cboStatsArea Is Null
End Sub
Can you advice please
Thank you