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
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