If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
filter combo box
I am trying to filter a combo box on a form using a combo box. The combo box
on the form cboVendorSelect is a bound combo box. The combo box that I am using as a filter cboVendorName is unbound. Both combo boxes contain two fields, VendorNo and VendorName and both draw from the same row source. The first field is the Bound Column in both combo boxes; both are hidden with only the VendorName showing on the form. All the fields are text. When I apply the filter I receive and error; Run-time error 2448 Can’t assign a value to this object. Here is the code I am using. Any suggestions? Private Sub cboVendorname_AfterUpdate() If Me.Dirty Then Me.Dirty = False 'Save first. Me.Filter = "[VendorNo]"" & Me.cboVendorname& """ Me.FilterOn = True End Sub Thanks in advance Tbotkin |
#2
|
|||
|
|||
filter combo box
It looks to me the Filter statement is malformed. I think it should be:
Me.Filter = "[VendorNo] = " & Me.cboVendorname assuming that [VendorNo] is a numeric Field. If [VendorNo] is a Text Field, then use: Me.Filter = "[VendorNo] = """ & Me.cboVendorname & """" Which line of code errored out in your test? Your code might have errored out before the Filter statement and I don't know the context of your update statement. -- HTH Van T. Dinh MVP (Access) "tbotkin" u28689@uwe wrote in message news:68d6820842b34@uwe... I am trying to filter a combo box on a form using a combo box. The combo box on the form cboVendorSelect is a bound combo box. The combo box that I am using as a filter cboVendorName is unbound. Both combo boxes contain two fields, VendorNo and VendorName and both draw from the same row source. The first field is the Bound Column in both combo boxes; both are hidden with only the VendorName showing on the form. All the fields are text. When I apply the filter I receive and error; Run-time error 2448 Can't assign a value to this object. Here is the code I am using. Any suggestions? Private Sub cboVendorname_AfterUpdate() If Me.Dirty Then Me.Dirty = False 'Save first. Me.Filter = "[VendorNo]"" & Me.cboVendorname& """ Me.FilterOn = True End Sub Thanks in advance Tbotkin |
#3
|
|||
|
|||
filter combo box
Thanks for the assistance, that did it.
Van T. Dinh wrote: It looks to me the Filter statement is malformed. I think it should be: Me.Filter = "[VendorNo] = " & Me.cboVendorname assuming that [VendorNo] is a numeric Field. If [VendorNo] is a Text Field, then use: Me.Filter = "[VendorNo] = """ & Me.cboVendorname & """" Which line of code errored out in your test? Your code might have errored out before the Filter statement and I don't know the context of your update statement. I am trying to filter a combo box on a form using a combo box. The combo box [quoted text clipped - 19 lines] Thanks in advance Tbotkin |
#4
|
|||
|
|||
filter combo box
You're welcome ... Glad to help ...
-- HTH Van T. Dinh MVP (Access) "tbotkin" u28689@uwe wrote in message news:68d9a12b35c54@uwe... Thanks for the assistance, that did it. |
Thread Tools | |
Display Modes | |
|
|