George - that's an idea - I was trying to use this in a Filter/FilterON FilterOff - but I guess I can try it in a query - I might need to change the name of the query to filter on, tho -
If anyone know's the syntax for the FILTER command and using the LIKE keyword - please help - thanks. --- In [email protected], "George Oro" <[EMAIL PROTECTED]> wrote: > > Never used form filter but it seems you have to remove the equal sign "=" > before the LIKE > > OR, > > If your form bound to a queries, you can put the below criteria under > Description grid on your query then put this code under AfterUpdate of > Select1 or Filter2 click: > > CRITERIA: > Like "*" & [Forms]![OfficeFormsSupplies]![Select1] & "*" > > AFTER UPDATE > me.requery > > > > HTH, > George > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] > Behalf Of Arthur > Sent: Wednesday, January 10, 2007 12:24 AM > To: [email protected] > Subject: [ms_access] Procedure to add "LIKE * [field name] * to search a > column in a table > > > OH man - am I ever having trouble with syntax or how to go about > adding a field to a form to Filter records with a "like" modifier so > the user doesn't have to type the whole item to bring up Records. > > I've got something like this > text field named [select1] which will be used to type in something > like "folder" to bring up all kinds of folders from column [DESCRIPTION] > > There's an event behind a button to do the selecting: > HELP - PLEASE!!! > The trouble is (obviously) in the "Else: " line > > Private Sub Filter2_Click() > On Error GoTo Err_Filter2_Click > > If IsNull(Me.Select1) Then > Me.FilterOn = False > > Else: Me.Filter = "OfficeFormsSupplies.Description = "LIKE "*" & > [Search Form].[Select1] & "*""" > > Me.FilterOn = True > End If > > > Exit_Filter2_Click: > Exit Sub > > Err_Filter2_Click: > MsgBox Err.Description > Resume Exit_Filter2_Click > > End Sub > > > > > > > [Non-text portions of this message have been removed] >
