Form Filter Issue

  • Thread starter Thread starter jneseth
  • Start date Start date
J

jneseth

I have a form that shows inventory, and some VBA in the background that gets
a partial part number, then applies that partial part number to a filter
leaving the expected result. This operates correctly using Access 2003, but
does not perform any filtering using access 2007. The code is below, please
any help??
Thanks!


answ1 = InputBox("Enter in the Part Number that you are looking for. If
uncertain of the complete number, just enter in the beginning portion. (eg..
Looking for part number12345678 but uncertain of the dash number, just put in
'12345678' and the results will show all items meeting the 12345678
criteria).", "Search for Part number")
Me.frm_LSO_change_quantity_sub1.Form.Filter = "[part_number] Like'" &
answ1 & "*'"
DoCmd.RunCommand acCmdApplyFilterSort
 
John, try something like this:

Dim strWhere As String
With Me.frm_LSO_change_quantity_sub1.Form
strWhere = "[part_number] Like """ & answ1 & """*'"
'debug.print strWhere
.Filter = strWhere
.FilterOn = True
End With
 
Back
Top