Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report won't display all records 1

Status
Not open for further replies.

annie52

Technical User
Mar 13, 2009
164
US
I have an unbound combobox on a popup form that I want to use to filter data on a report. If I choose a particular technician from the combobox, the report filters correctly. However, when I choose "All Technicians", I jump to the Else part of the code. The Locals window shows that stSelectTech has the following value:
"Tech='All Technicians'"

Dim stDocName As String, stSelectTech As String

stDocName = "rptFollowup"
stSelectTech = "Tech='" & Forms![frmTechnician]![cboTechnician] & "'"
DoCmd.Close acForm, "frmTechnician", acSaveNo
If stSelectTech = "All Technicians" Then
DoCmd.OpenReport stDocName, acViewPreview
Else
DoCmd.OpenReport stDocName, acPreview, , stSelectTech
End If
 
Replace this:
If stSelectTech = "All Technicians" Then
with either this:
If Forms![frmTechnician]![cboTechnician] = "All Technicians" Then
or this:
If stSelectTech = "Tech='All Technicians'" Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top