I have a DB with a form and subform. My form is for adding the clients and my sub form is the Work Invoices for the clients. My two table are linked. What I want to be able to do is selct a client and WorkID (Work Invoice) and print a report (Invoice) with the clients info that I selected and the WorkID that I have selcected. I have the report already made and have added the Print invoice button on my MainForm and not the subform. But the code I found online is not work to print my invoice. Code below
Dim strWhere As String
strWhere = "[WorkID] = " & Forms!tblWorkSubForum!WorkID
DoCmd.OpenReport "rptWorkOrderInvoice", acViewPreview, strWhere
What am I doing wrong? I have tried a few codes I found online.
Dim strWhere As String
strWhere = "[WorkID] = " & Forms!tblWorkSubForum!WorkID
DoCmd.OpenReport "rptWorkOrderInvoice", acViewPreview, strWhere
What am I doing wrong? I have tried a few codes I found online.