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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating filtered report based on user input in form

Status
Not open for further replies.

kiki13

Technical User
Feb 10, 2003
5
0
0
US
OK, I have a form with an unbound listbox(Named OrderNum) and the row source is pointing to a table of orders. There is a command button on the form to preview the report based on the order selected by the user. However, when you preview the report, it does not filter out the other orders, and it does't even go to the correct order. Am I missing something in the code, or is there a property I need to change in order for this to work. Please help!!

My code in the preview box is:

If IsNull(OrderNum) Then
MsgBox "Please Select an Order."
Else
strDocName = "Ohio School Packing List"
strLinkCriteria = "OrderNum = " & OrderNumber
DoCmd.OpenReport strDocName, acViewPreview, , strLinkCriteria
End If
 
I do the same thing basically...

If Me.cbo_UserGroup.Value = "ALL" Then
lcWhere = ""
Else
lcWhere = "USERGROUP ='" & Me.cbo_UserGroup.Value & "'"
End If

stDocName = "rpt_Fed_Bene"
DoCmd.OpenReport stDocName, acPreview, , lcWhere

I do set the Filter On property of the report form to "Yes". Perhaps check this. htwh, Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top