Empty field in a form to show all values in Report...???

J

Johanna

I have a form already that is making the function of a filter for the
parameters that are in a table and I want to made the report with all the
information for a specific field.


Actually I am writing a program through Access in VB to generate some
reports, would like to have an option where it will allowed to show all the
information, regardless of the field, for example if is empty or I have to
put something in special to have all the information in the report.



Look what I wrote, the problem is when CondBrand gets null or empty, how can
I made the report wiill take all the brands...???



Private Sub Next01_Click()

Dim Condition As String

Dim CondBrand

CondBrand = Me.Combo509

If IsNull(CondBrand) Then
MsgBox ("condition Brand is Null")

CondBrand = "all"

End If

Condition = "[Inspection Date]>=" & "#" & Me![From] & "#" & " And
[Inspection Date]<=" & "#" & Me![To] & "#" & " and [Brand]= '" & CondBrand &
"'"

DoCmd.OpenReport "General field and failure 13 Cable",
acViewPreview, , Condition

End Sub
 
J

John Spencer

Private Sub Next01_Click()

Dim Condition As String

Dim CondBrand

CondBrand = Me.Combo509

If IsNull(CondBrand) Then
MsgBox ("condition Brand is Null")
ELSE
Condition = " and [Brand]= '" & CondBrand & "'"
End If

Condition = "[Inspection Date]>=" & "#" & Me![From] & "#" & " And
[Inspection Date]<=" & "#" & Me![To] & "#" & Condition

DoCmd.OpenReport "General field and failure 13 Cable", _
acViewPreview, , Condition

End Sub




'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top