open report command - wherecondition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writing an docmt.openreport where a condition exists. How do I request
user imput on the condition?
 
Place a control on your form that contains your DoCmd.OpenReport method and
try something like:

Dim strWhere as String
strWhere = "1 = 1 "
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & " And [DateField]>=#" & Me.txtStartDate & "#"
End If
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
 
Back
Top