Hello,
I have a contact database. On the search form, I have 2 text boxes to allow the user to search by firstname &/or last name. After enterting the search criteria, the user should press a button so that all the records that meet the search criteria appear in a list box. I did that by doing a query "strSQL" and applying it to the list box. Everything works fine.
I also created a report that takes all the records from the contacts table.
I have another button on my form that should open this report filtering the records available in the list box. I know that I already have the query "strSQL", and I tried to open the report by typing in the OnClick Event of the button:
DoCmd.OpenReport stDocName, acPreview, strSQL
But the report keep on showing me all the records in the contacts table.
Please help!
I have a contact database. On the search form, I have 2 text boxes to allow the user to search by firstname &/or last name. After enterting the search criteria, the user should press a button so that all the records that meet the search criteria appear in a list box. I did that by doing a query "strSQL" and applying it to the list box. Everything works fine.
I also created a report that takes all the records from the contacts table.
I have another button on my form that should open this report filtering the records available in the list box. I know that I already have the query "strSQL", and I tried to open the report by typing in the OnClick Event of the button:
DoCmd.OpenReport stDocName, acPreview, strSQL
But the report keep on showing me all the records in the contacts table.
Please help!