Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apply filter on form using combobox selection 2

Status
Not open for further replies.

OzzieTheOwl

Technical User
Jun 26, 2006
61
GB
Hi

I am new to Access VBA and am struggling to get this to work. I have a form with a combobox on, I also have a search button. What I want is to be able to filter for the value in the combobox.

I have the following code

Code:
    txtFilter = Form_Address.cmbOracleName.Value
    Me.Form.Filter = "Oracle Name='" & txtFilter & "'"
    Me.Form.FilterOn = True
But when I run it I get the following error message

Run Time Error 2448
You Can't Assign A Value To This Object

As far as I know, the object is not a control on a read only form, the form is not open in design view, and the value is not too large for the field.

I quite possibly have the coding all wrong, so any help would be appreciated.

Cheers

Barney
 
You may try this:
Me.Form.Filter = "[Oracle Name]='" & txtFilter & "'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top