Dear All,
I have wrote in VBA access, and when i run combobox on this form, in Month1, i saw #name?, in datasheet. help me:banghead:
Private Sub Combo33_AfterUpdate()
[Form_Monthlyreportbydate].RecordSource = "PARAMETERS [forms].[Report Menu].[combo33] DateTime; " & _
"TRANSFORM Sum(NZ([Net1],0)) AS Expr1 " & _
" SELECT Format([dateprod],'mmmm-yyyy') AS Month1, speciesbybuyer2.dateprod, speciesbybuyer2.Buyer, speciesbybuyer2.Species1, speciesbybuyer2.Grade, Sum(NZ([Net1],0)) AS [Total Of Net(m3)] " & _
" FROM speciesbybuyer2 " & _
" WHERE (((Format([Dateprod], 'mmm-yyyy')) = [Forms].[Report Menu].[Combo33])) " & _
" GROUP BY Format([dateprod],'mmmm-yyyy'), speciesbybuyer2.dateprod, speciesbybuyer2.Buyer, speciesbybuyer2.Species1, speciesbybuyer2.Grade " & _
" PIVOT speciesbybuyer2.Bandsaw In (1,2,3,4,5,6,7,8,9,10,11,12);"
End Sub
I have wrote in VBA access, and when i run combobox on this form, in Month1, i saw #name?, in datasheet. help me:banghead:
Private Sub Combo33_AfterUpdate()
[Form_Monthlyreportbydate].RecordSource = "PARAMETERS [forms].[Report Menu].[combo33] DateTime; " & _
"TRANSFORM Sum(NZ([Net1],0)) AS Expr1 " & _
" SELECT Format([dateprod],'mmmm-yyyy') AS Month1, speciesbybuyer2.dateprod, speciesbybuyer2.Buyer, speciesbybuyer2.Species1, speciesbybuyer2.Grade, Sum(NZ([Net1],0)) AS [Total Of Net(m3)] " & _
" FROM speciesbybuyer2 " & _
" WHERE (((Format([Dateprod], 'mmm-yyyy')) = [Forms].[Report Menu].[Combo33])) " & _
" GROUP BY Format([dateprod],'mmmm-yyyy'), speciesbybuyer2.dateprod, speciesbybuyer2.Buyer, speciesbybuyer2.Species1, speciesbybuyer2.Grade " & _
" PIVOT speciesbybuyer2.Bandsaw In (1,2,3,4,5,6,7,8,9,10,11,12);"
End Sub