G
Guest
Help!!
I have spent days trying to get something very simple to work in Access 2007
to no avail, despite the many suggestions from many of you. I can accomplish
this in minutes using ASP.Net, but I must be missing something in Access.
I have a form that is bound to a query. One of the fields on the form is
called Name. On the same form, I have a combo box called NameDropDown, and a
command button called SearchButton.
When the form is first opened, it displays the fields from the first record
in the query. I would like to be able to select a name from the NameDropDown,
click the SearchButton, and have the form display the respective fields for
the selected name.
The following is the code I have behind the OnClick event of SearchButton:
Private Sub SearchButton_Click()
Me.Filter = "[Name] = '" & Me![NameDropDown] & "'"
Me.FilterOn = True
End Sub
I have tried with [], and without []. I have tried with single quotes and
without single quotes.
Whenever I click the SearchButton, there is no change to the form contents.
Please help me solve this problem or I may be forced to go back to dBase!!
Thanks.
I have spent days trying to get something very simple to work in Access 2007
to no avail, despite the many suggestions from many of you. I can accomplish
this in minutes using ASP.Net, but I must be missing something in Access.
I have a form that is bound to a query. One of the fields on the form is
called Name. On the same form, I have a combo box called NameDropDown, and a
command button called SearchButton.
When the form is first opened, it displays the fields from the first record
in the query. I would like to be able to select a name from the NameDropDown,
click the SearchButton, and have the form display the respective fields for
the selected name.
The following is the code I have behind the OnClick event of SearchButton:
Private Sub SearchButton_Click()
Me.Filter = "[Name] = '" & Me![NameDropDown] & "'"
Me.FilterOn = True
End Sub
I have tried with [], and without []. I have tried with single quotes and
without single quotes.
Whenever I click the SearchButton, there is no change to the form contents.
Please help me solve this problem or I may be forced to go back to dBase!!
Thanks.