Hello everyone
I am attempting to use Bob Larson's export to excel function on a button on one of my forms.
The query I am basing the export on references values stored in a form. When I run the module i get an error To few parameters. Expected 4.
Coincidentally the query has for parameters in it. See the sql belo
However if I eliminate the where statement all is fine. See sql below
Any suggestions would be greatly appreciated.
I am attempting to use Bob Larson's export to excel function on a button on one of my forms.
The query I am basing the export on references values stored in a form. When I run the module i get an error To few parameters. Expected 4.
Coincidentally the query has for parameters in it. See the sql belo
Code:
SELECT tbl_Company.CompanyName, tbl_Company.Address1, tbl_Company.Address2, tbl_Company.City, tbl_Company.Province, tbl_Company.PostalCode, tbl_Company.Telephone, tbl_Company.Fax, tbl_Company.GeneralEmail, tbl_Company.Website, tbl_Company.Area, tbl_Company.CompanyCategory, tbl_Company.LastCallDate, tbl_Company.NextCallDate, tbl_Company.AssignedTo, tbl_Company.EnteredBy
FROM tbl_Company
WHERE (((tbl_Company.City) Like [Forms]![frm_MainMenu]![sfrm_Reports].[Form]![cboSelectCity] & "*") AND ((tbl_Company.Area) Like [Forms]![frm_MainMenu]![sfrm_Reports].[Form]![cboSelectAreaofCity] & "*") AND ((tbl_Company.CompanyCategory) Like [Forms]![frm_MainMenu]![sfrm_Reports].[Form]![cboSelectBusinessCategory] & "*") AND ((tbl_Company.EnteredBy) Like [Forms]![frm_MainMenu]![sfrm_Reports].[Form]![cboSelectEnteredby] & "*"))
ORDER BY tbl_Company.CompanyName;
However if I eliminate the where statement all is fine. See sql below
Code:
SELECT tbl_Company.CompanyName, tbl_Company.Address1, tbl_Company.Address2, tbl_Company.City, tbl_Company.Province, tbl_Company.PostalCode, tbl_Company.Telephone, tbl_Company.Fax, tbl_Company.GeneralEmail, tbl_Company.Website, tbl_Company.Area, tbl_Company.CompanyCategory, tbl_Company.LastCallDate, tbl_Company.NextCallDate, tbl_Company.AssignedTo, tbl_Company.EnteredBy
FROM tbl_Company
ORDER BY tbl_Company.CompanyName;`
Any suggestions would be greatly appreciated.