I designed a dialog box with a combo to select individual vendors from
a form and its related data for print ouput. Though the dialog box
seems to work okay, I apparently do not have the filtering code behind
the OnOpen Event Procedure of the report structured correctly.
Anyone's assistance will be appreciated, although I would like to stay
on the same track.
Here is what I have done:
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 and a few more.
Thanks for your assistance.