A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

filter combo box



 
 
Thread Tools Display Modes
  #1  
Old November 5th, 2006, 03:20 PM posted to microsoft.public.access.forms
tbotkin
external usenet poster
 
Posts: 2
Default 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  
Old November 5th, 2006, 08:47 PM posted to microsoft.public.access.forms
Van T. Dinh
external usenet poster
 
Posts: 1,048
Default 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  
Old November 5th, 2006, 09:17 PM posted to microsoft.public.access.forms
tbotkin
external usenet poster
 
Posts: 2
Default 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  
Old November 6th, 2006, 01:31 AM posted to microsoft.public.access.forms
Van T. Dinh
external usenet poster
 
Posts: 1,048
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.