S
sugarbear
Any help is appreciated! I have a combo box on a main form to search for
orders by part number on a subform. The part number can end with a U or a UA
dependent on how it was purchased. I want to enter a part number,
ie...12345...and see ALL orders including part numbers 12345U or
12345UA....I've seen some discussions on this but none have helped my
situation or I'm not thinking clearly. I know its really really easy, just
can't think! I have this combo box on a different form and the code I'm
using works great, however, now I'm dealing with a subform, or even if I want
to enter the part number in a combo box, then open another form and have the
filtered data. The code I have below I'm using and not working. What am I
missing or need to add to this make it work for the subform?
im stDocName As String
Dim stLinkCriteria As String
Dim lngLen As Long
stDocName = "frmOrders"
If Not IsNull(Me![ComboBox]) Then
stLinkCriteria = strLinkCriteria & "*" = ([PartNumber] Like "" * " &
Me![ComboBox] & " * "") And "
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
lngLen = Len(strLinkCriteria) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strLinkCriteria = Left$(strLinkCriteria, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
I know I'm missing something. Thanks!
orders by part number on a subform. The part number can end with a U or a UA
dependent on how it was purchased. I want to enter a part number,
ie...12345...and see ALL orders including part numbers 12345U or
12345UA....I've seen some discussions on this but none have helped my
situation or I'm not thinking clearly. I know its really really easy, just
can't think! I have this combo box on a different form and the code I'm
using works great, however, now I'm dealing with a subform, or even if I want
to enter the part number in a combo box, then open another form and have the
filtered data. The code I have below I'm using and not working. What am I
missing or need to add to this make it work for the subform?
im stDocName As String
Dim stLinkCriteria As String
Dim lngLen As Long
stDocName = "frmOrders"
If Not IsNull(Me![ComboBox]) Then
stLinkCriteria = strLinkCriteria & "*" = ([PartNumber] Like "" * " &
Me![ComboBox] & " * "") And "
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
lngLen = Len(strLinkCriteria) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strLinkCriteria = Left$(strLinkCriteria, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
I know I'm missing something. Thanks!