L
Legris
Would someone take a look at my code and see what I missed please. My goal
is to choose dates for when we acquired the item, drop down for Product
Number 1-3 (cbxProdNo) and a dropdown for a text Item (cbxItem) and view a
report of the result.
Private Sub cbxItem_AfterUpdate()
Dim strsql As String
Set db = CurrentDb
Dim rst As Recordset
If Me!cbxProductNumber = 1 Then
strsql = "qryMFG QC Scrap Detail by Item ProductNumber1"
If Me!cbxProductNumber = 2 Then
strsql = "qryMFG QC Scrap Detail by Item ProductNumber2"
If Me!cbxProductNumber = 3 Then
strsql = "qryMFG QC Scrap Detail by Item ProductNumber3"
Else
strsql = "qryMFG QC Scrap Detail by Item"
End If
End If
End If
Me!lbxProduction.RowSource = strsql
Me!cbxClassCode = " "
End Sub
What my end result is it will not break it down into individual product
numbers on the report, but still gives me items for all three product numbers.
The last query is suppose give me all, but the numbered queries I just was to
see the Item for that product number selected in those specified queries.
Here is sample query:
Date = Between [Forms]![frmItem]![txtStartDate] and [Forms]!{frmItem]!
[txtEndDate]
ProductNumber = Like "1" (so on for the other two queries)
On the query for it to list all, I have:
Date = Between [Forms]![frmItem]![txtStartDate] and [Forms]!{frmItem]!
[txtEndDate]
Item = [Forms]![frmItem]![cbxItem]
Not too good at this, so any advice is much appreciated. Thank you.
Legris
is to choose dates for when we acquired the item, drop down for Product
Number 1-3 (cbxProdNo) and a dropdown for a text Item (cbxItem) and view a
report of the result.
Private Sub cbxItem_AfterUpdate()
Dim strsql As String
Set db = CurrentDb
Dim rst As Recordset
If Me!cbxProductNumber = 1 Then
strsql = "qryMFG QC Scrap Detail by Item ProductNumber1"
If Me!cbxProductNumber = 2 Then
strsql = "qryMFG QC Scrap Detail by Item ProductNumber2"
If Me!cbxProductNumber = 3 Then
strsql = "qryMFG QC Scrap Detail by Item ProductNumber3"
Else
strsql = "qryMFG QC Scrap Detail by Item"
End If
End If
End If
Me!lbxProduction.RowSource = strsql
Me!cbxClassCode = " "
End Sub
What my end result is it will not break it down into individual product
numbers on the report, but still gives me items for all three product numbers.
The last query is suppose give me all, but the numbered queries I just was to
see the Item for that product number selected in those specified queries.
Here is sample query:
Date = Between [Forms]![frmItem]![txtStartDate] and [Forms]!{frmItem]!
[txtEndDate]
ProductNumber = Like "1" (so on for the other two queries)
On the query for it to list all, I have:
Date = Between [Forms]![frmItem]![txtStartDate] and [Forms]!{frmItem]!
[txtEndDate]
Item = [Forms]![frmItem]![cbxItem]
Not too good at this, so any advice is much appreciated. Thank you.
Legris