I just want to have solution on this problem I encounter on my SQL Statement. Code below:
If frmReport.cboInventory.Text = "Monthly Reports" Then Dim rpt4 As rptInventory Set rpt4 = rptInventory rpt4.daoInventory.DatabaseName = "database.mdb" rpt4.daoInventory.RecordSource = "Select * from tblInvoice, tblProduct where pmonth='" & frmDateInventory.txtMonth.Text & "' and pyear='" & frmDateInventory.cboYear.Text & "'" rptInventory.Sections("PageHeader").Controls.Item("lblHeader").Caption = "MONTHLY INVENTORY REPORT" rptInventory.Sections("ReportFooter").Controls.Item("lblTotal").Caption = lblTotal rpt4.Show
on my code, I use database named as "database" and I wish to access two table named as tblInvoice, tblProduct both table have the same field name (pmonth, pyear). This two fields must be equal to the txtMonth for pmonth and txtYear for cboYear and will show results. My problem is that it never generate any results. Surely because of the SQL Statement I use
Any help is much appreciated!