E
Eric
How do I get results from a SQL statement in VBA Code?
What I basically need from the code is how many instances
there are.
Here's my code that populates a list box from when a user
inputs a product code.
Private Sub cmbProductCode_AfterUpdate()
Dim strProduct As String, iPlant As Integer
If Me.OpenArgs = "PEPSAvg" Then
Me.txtLineCode.DefaultValue = Chr$(34) &
Me.txtLineCode & Chr$(34)
End If
If Not IsNull(Me.cmbProductCode) Then
strProduct = Me.cmbProductCode
iPlant = [Forms]![frmAnalysisTG]![cmbPlantCode]
Me.cmbPrintID.RowSource = "SELECT ActivePrint.ID,
ActivePrint.PrintName " _
& "FROM ActivePrint " _
& "WHERE ActivePrint.ProductCode = " & Chr$(34) &
strProduct & Chr$(34) & " " _
& "And ActivePrint.PlantCode = " & iPlant & " And
ActivePrint.IsInactive = 0 " _
& "ORDER BY ActivePrint.PrintName;"
Me.cmbPrintID.Requery
End If
End Sub
What I basically need from the code is how many instances
there are.
Here's my code that populates a list box from when a user
inputs a product code.
Private Sub cmbProductCode_AfterUpdate()
Dim strProduct As String, iPlant As Integer
If Me.OpenArgs = "PEPSAvg" Then
Me.txtLineCode.DefaultValue = Chr$(34) &
Me.txtLineCode & Chr$(34)
End If
If Not IsNull(Me.cmbProductCode) Then
strProduct = Me.cmbProductCode
iPlant = [Forms]![frmAnalysisTG]![cmbPlantCode]
Me.cmbPrintID.RowSource = "SELECT ActivePrint.ID,
ActivePrint.PrintName " _
& "FROM ActivePrint " _
& "WHERE ActivePrint.ProductCode = " & Chr$(34) &
strProduct & Chr$(34) & " " _
& "And ActivePrint.PlantCode = " & iPlant & " And
ActivePrint.IsInactive = 0 " _
& "ORDER BY ActivePrint.PrintName;"
Me.cmbPrintID.Requery
End If
End Sub