Fred wrote:
[Quoted Text] >Experienced on Access, very very very newbie on code. > >In order to learn (step 1 of 100 of figuring out Allen Browne's multi-field >form filter example) trying to do the most basic example of setting a filter >criteria; filter for exact match between user input into an unbound text box > and a field "field1" > >Just to start somewhere: > >Made an unbound text box named Field1InputTextBox >Made an button named "ButtonToLaunchFilter" > >Put code for "on Click" event of the button as follows: > >(this is the code for the entire form) > >Option Compare Database > >Private Sub ButtonToLaunchFilter_Click() > >Me.Filter = "[Field1] = Me.Field1InputTextBox" >Me.FilterOn = True > >End Sub
For a number type field, that should be:
Me.Filter = "[Field1] = " & Me.Field1InputTextBox
For a Text field"
Me.Filter = "[Field1] = """ & Me.Field1InputTextBox & """"
-- Marsh MVP [MS Access]
|