I am getting an error about Focus in my lookup combo box:
"You can’t reference a property or method for a control unless the control has the focus."
Look 9 lines below where i remark, "'next row is yellowed in the debug". The vba is from an earlier tek-tips request which worked fine in a dummy model but boms out in my real model. I don't understand selStart.
Molly
"You can’t reference a property or method for a control unless the control has the focus."
Look 9 lines below where i remark, "'next row is yellowed in the debug". The vba is from an earlier tek-tips request which worked fine in a dummy model but boms out in my real model. I don't understand selStart.
Molly
Code:
Private Sub cboDescriptionFilter_AfterUpdate()
'Unique product ID column numbering from zero.
If Not IsNull(Me.cboDescriptionFilter.Column(2)) Then
Me.Recordset.FindFirst "FormulaID=" & Me.cboDescriptionFilter.Column(2)
End If
End Sub
Private Sub cboDescriptionFilter_Change()
'next row is yellowed in the debug
If Me.cboDescriptionFilter.SelStart > 0 Then
strText = Mid(Me.cboDescriptionFilter.Text, 1, Me.cboDescriptionFilter.SelStart)
Else
strText = Me.cboDescriptionFilter.Text
End If
strSQL = "SELECT q.[Description], q.[ProductFamilyID], q.[ProductID], " _
& "q.[PackTypeID], q.[PriceTypeID], q.[ProductType], q.[Inactive Product] " _
& "FROM QryProduct AS q"
strOrder = "ORDER BY [Description], [ProductFamilyID], [ProductID];"
'This will select all if cboDescriptionFilter is empty
strFilter = "WHERE [Description] Like '*" & strText & "*'"
'Change Row Source
Me.cboDescriptionFilter.RowSource = strSQL & " " & strFilter & " " & strOrder
Me.cboDescriptionFilter.Dropdown
End Sub