View Single Post
  #2  
Old September 30th, 2007, 11:05 PM posted to microsoft.public.access.forms
Shael
external usenet poster
 
Posts: 24
Default Search button on form

I have a form that is bound to a query. When I first open up the form, the
form displays fields from the first record.

On the same form, I have a drop down (NameDropDown) and a command button
(SearchBatter). What I want to happen is when the user selects an item from
the drop down and clicks the command button, I want the form to display the
fields that relate to the value in the drop down.

I have the following code in the Click event of the command button:

Private Sub SearchBatter_Click()
Dim strWhere As String
Dim strName As String

strName = Me.NameDropDown
strWhere = "([Name] = """ & strName & """)"
Me.Filter = strWhere
Me.FilterOn = True
End Sub

When I select a value from the drop down and click the button, nothing
changes in the form.

Can you help?