I need to create a few reports using one query and I wish to do the program filter from the buttons in a form. I had created a query named q_ClientsHvServ ices and a report based on that query named Rpt_ClientsHvSe rvice. In the main form, I created few buttons to view clients from different progrom. When I click on a button named "HACC", the report should select all the clients that have services under PROGRAM starting with HA (and all HA*). When I click on a button named "CACP", the report should select all the clients starting with "CAC" program. Is it possible?
How should I write the filter based on the click on the buttons?
My code on my "All client" button are as follow:
How should I write the filter based on the click on the buttons?
My code on my "All client" button are as follow:
Code:
Private Sub btn_OpenALLClientsHvSvc_Click() On Error GoTo Err_btn_OpenALLClientsHvSvc_Click Dim stDocName As String stDocName = "Rpt_ClientsHvService" DoCmd.OpenReport stDocName, acPreview Exit_btn_OpenALLClientsHvSvc_Click: Exit Sub Err_btn_OpenALLClientsHvSvc_Click: MsgBox Err.Description Resume Exit_btn_OpenALLClientsHvSvc_Click End Sub
Comment