Hello,
I have searched for about a week on how to get this done and I keep drawing blanks. I want to use the results of a filtered form to export out to a report that can be printed.
Here is what I have built thus far.
frmSCBSearchRecords - is a key word search form that has a sub form embedded in it to show the results of the key word.
sfrmCustomerList - is the subform listed above mentioned form.
qryFormResults - is a query that pulls the data from the search list but is only showing the first record in that filtered group instead of all the records that fit that criteria; and that SQL looks like:
SELECT tblMasterSCBDB.[LC No], tblMasterSCBDB.Beneficiary, tblMasterSCBDB.[Vendor No], tblMasterSCBDB.[Bill No], tblMasterSCBDB.[Transaction Date], tblMasterSCBDB.[Bill Amount], tblMasterSCBDB.[PO No], tblMasterSCBDB.[Invoice No], tblMasterSCBDB.[PO Drawn]
FROM tblMasterSCBDB
WHERE (((tblMasterSCBDB.[LC No])=Forms!frmSCBSearchRecords!SubCustomerList.Form![LC No]) And ((tblMasterSCBDB.Beneficiary)=Forms!frmSCBSearchRe cords!SubCustomerList.Form!Beneficiary) And ((tblMasterSCBDB.[Vendor No])=Forms!frmSCBSearchRecords!SubCustomerList.Form![Vendor No]) And ((tblMasterSCBDB.[Bill No])=Forms!frmSCBSearchRecords!SubCustomerList.Form![Bill No]) And ((tblMasterSCBDB.[Transaction Date])=Forms!frmSCBSearchRecords!SubCustomerList.Form![Transaction Date]) And ((tblMasterSCBDB.[Bill Amount])=Forms!frmSCBSearchRecords!SubCustomerList.Form![Bill Amount]) And ((tblMasterSCBDB.[PO No])=Forms!frmSCBSearchRecords!SubCustomerList.Form![PO No]) And ((tblMasterSCBDB.[Invoice No])=Forms!frmSCBSearchRecords!SubCustomerList.Form![Invoice No]) And ((tblMasterSCBDB.[PO Drawn])=Forms!frmSCBSearchRecords!SubCustomerList.Form![PO Drawn]));
On the frmSCBSearchRecords form I have a "Create Report" button with a simple action code:
Private Sub btnCreateReport_Click()
DoCmd.OpenReport "rptNewReport", acViewPreview, ,
End Sub
What I need help on is having all the selected records from the key word search export to a report that can be printed instead of just the first record in the group. Any help would be appreciated.