The problem to resolve should be pretty easy for someone. I have a
main form which contains a combo box to lookup various vendors. Have
several reports for the vendors, but it is print all or none.
So here is what I have done and would like to stay on the same track.
1. Created a new vendor query (qryVendorRpt) with only the needed
fields including the combo box (cboVendorsMain) from the main form
(frmMain).
2. Of course, created a new vendor report (rptVendorDetail).
3. Created a Dialog Form (frmVendorDialog) that contains the
(cboVendors) combo box with its RowSource set to the Vendors Table
(tblVendors). Also included on the Dialog Form is Cancel (cmdClose)
button and an OK (cmdOkay) button which is set to Me.Visible = False.
4. Then inserted code behind the OnOpen report Event Procedure. The
code below obviously is not working and needs to be tweaked.
Suggestions are welcomed.
5. I want to be able to choose "All Vendors" as well as optionally
choosing a single one for report output.
DoCmd.OpenForm "frmVendorDialog",,,,,acDialog
Me!Vendors = Forms![frmVendorDialog]![cboVendors]
DoCmd.Close acForm, "frmVendorDialog"
If Me!Vendors <> "All Vendors" Then
DoCmd.ApplyFilter , "[Me!Vendors]='" & Vendors & "'"
End If
A couple of error codes noted - 2448 can't assign a value to this
object, 2450 can't find form.
Thanks for your assistance.