Probably an easy one for somebody but I've hit the wall after 3.5 hours tonight.
I have a form, on it is a combo box. There are also two text boxes set to date format where the user can enter Start and End dates.
Dependent upon the value selected by the user from the combo box and the date range a search delivers results from the database.
I would like to either display the results in a subform which can then be printed out or, ideally, a report which can then be printed out.
I have tried passing OpenArgs for the report and got nowhere, and the subform is the final nail in the coffin tonight.
I have the following as a search string, it does work when run through the query builder, but I just can't figure using this to generate output in either subform or report.
(ignore the naming conventions, it works for me so that's all that matters at the moment).
I used the Debug.print to verify values being collected from the form controls.
Here's the code:
Thanks, Lol
I have a form, on it is a combo box. There are also two text boxes set to date format where the user can enter Start and End dates.
Dependent upon the value selected by the user from the combo box and the date range a search delivers results from the database.
I would like to either display the results in a subform which can then be printed out or, ideally, a report which can then be printed out.
I have tried passing OpenArgs for the report and got nowhere, and the subform is the final nail in the coffin tonight.
I have the following as a search string, it does work when run through the query builder, but I just can't figure using this to generate output in either subform or report.
(ignore the naming conventions, it works for me so that's all that matters at the moment).
I used the Debug.print to verify values being collected from the form controls.
Here's the code:
Code:
Private Sub Btn_PPE_Search_Click()
strCategory = Me.Cbo_PPE_Category.Value
strSearch = "SELECT Tbl_Issue.Issue_Employee_ID,
Tbl_PPE.PPE_PPE_Category, Tbl_PPE.PPE_PPE_Description, Tbl_Issue.Issue_PPE_Size, Tbl_Issue.Qty_Issue, Tbl_Issue.Date_Issued " & _
"FROM Tbl_Employees INNER JOIN (Tbl_PPE INNER JOIN Tbl_Issue ON Tbl_PPE.[PPE_ID] = Tbl_Issue.[Issue_PPE_ID]) ON Tbl_Employees.Employee_Employee_ID = Tbl_Issue.Issue_Employee_ID " & _
"WHERE (((Tbl_PPE.PPE_PPE_Category)=[strCategory]) AND ((Tbl_Issue.Date_Issued) Between [Txt_Start_Date.Value] And [Txt_End_Date.value]));"
Debug.Print strSearch
Debug.Print strCategory
Debug.Print Me.Txt_End_Date.Value
Debug.Print Me.Txt_Start_Date.Value
End Sub
Thanks, Lol