Hi!
Assuming your form will have three combo boxes and a command button you can use the following:
Private Sub CommandButton_Click()
Dim Criteria As String
Dim CriteriaCount As Integer
CriteriaCount = 0
If Nz(Len(cbosample_type),0) <> 0 Then
Criteria = "sample_type = '" & cbosample_type & "'"
CriteriaCount = 1
End If
If Nz(Len(cbogenerator),0) <> 0 Then
If CriteriaCount = 0 Then
Criteria = "generator = '" & cbogenerator & "'"
CriteriaCount = 1
Else
Criteria = Criteria & " And generator = '" & cbogenerator & "'"
End If
End If
If Nz(Len(cbologindate),0) <> 0 Then
If CriteriaCount = 0 Then
Criteria = "logindate = #" & cbologindate & "#"
CriteriaCount = 1
Else
Criteria = Criteria & " And logindate= #" & cbologindate & "#"
End If
End If
DoCmd.OpenReport "ReportName", acViewPreview, , Criteria
End Sub
There are other ways to go about it so if you need more information let me know.
hth
Jeff Bridgham