combo box filter


B

Bibi

I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 
Ad

Advertisements

G

Golfinray

Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8
 
B

Bibi

Thank you for the response - I just can't get it to work!
Here's the afterupdate event
Private Sub Combo30_AfterUpdate()
Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """Me.filteron = true"
End Sub

Here's the combo30 row source
SELECT qAmenityCategory.AmenityCategory FROM qAmenityCategory ORDER BY
[AmenityCategory] DESC;

It does not update...no value is entered in to the combo box...any ideas
what I am missing????
Thank you for any suggestions.
Bibi


Golfinray said:
Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8

Bibi said:
I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 
G

Golfinray

Me.filteron = true is a separate line.

Bibi said:
Thank you for the response - I just can't get it to work!
Here's the afterupdate event
Private Sub Combo30_AfterUpdate()
Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """Me.filteron = true"
End Sub

Here's the combo30 row source
SELECT qAmenityCategory.AmenityCategory FROM qAmenityCategory ORDER BY
[AmenityCategory] DESC;

It does not update...no value is entered in to the combo box...any ideas
what I am missing????
Thank you for any suggestions.
Bibi


Golfinray said:
Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8

Bibi said:
I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 
C

Cheese_whiz

Hi Bibi,

In addition to splitting that up into two lines (as Golfinray pointed out),
you need 4 double quotation marks at the end, not just 3, and you don't need
any double (or single) quotation marks in the second line:

Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """"
Me.FilterOn = True

HTH,
CW

Bibi said:
Thank you for the response - I just can't get it to work!
Here's the afterupdate event
Private Sub Combo30_AfterUpdate()
Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """Me.filteron = true"
End Sub

Here's the combo30 row source
SELECT qAmenityCategory.AmenityCategory FROM qAmenityCategory ORDER BY
[AmenityCategory] DESC;

It does not update...no value is entered in to the combo box...any ideas
what I am missing????
Thank you for any suggestions.
Bibi


Golfinray said:
Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8

Bibi said:
I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 
B

Bibi

Thank you so much! I should be able to take this and expand my skills from
here - everytime I register for an SQL course it's cancelled so I guess this
is the way I'll learn it. My deduction is that the separate line is necessay
because it is a separate condition - if it's really for some other arcane
reason - and you have the time, please let me know.
Thank you
Bibi

Golfinray said:
Me.filteron = true is a separate line.

Bibi said:
Thank you for the response - I just can't get it to work!
Here's the afterupdate event
Private Sub Combo30_AfterUpdate()
Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """Me.filteron = true"
End Sub

Here's the combo30 row source
SELECT qAmenityCategory.AmenityCategory FROM qAmenityCategory ORDER BY
[AmenityCategory] DESC;

It does not update...no value is entered in to the combo box...any ideas
what I am missing????
Thank you for any suggestions.
Bibi


Golfinray said:
Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8

:

I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 
Ad

Advertisements

B

Bibi

Thank you! It's all trial and error for me - with more emphasis on the error
- If you have the time could you let me know what the quotation signs denote.
Then I'll never have to ask again!
Thank you

Bibi

Cheese_whiz said:
Hi Bibi,

In addition to splitting that up into two lines (as Golfinray pointed out),
you need 4 double quotation marks at the end, not just 3, and you don't need
any double (or single) quotation marks in the second line:

Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """"
Me.FilterOn = True

HTH,
CW

Bibi said:
Thank you for the response - I just can't get it to work!
Here's the afterupdate event
Private Sub Combo30_AfterUpdate()
Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """Me.filteron = true"
End Sub

Here's the combo30 row source
SELECT qAmenityCategory.AmenityCategory FROM qAmenityCategory ORDER BY
[AmenityCategory] DESC;

It does not update...no value is entered in to the combo box...any ideas
what I am missing????
Thank you for any suggestions.
Bibi


Golfinray said:
Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8

:

I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 
Ad

Advertisements

C

Cheese_whiz

Hi Bibi,

Glad it worked out!

Allen Browne has a short primer on his site that will do a better job than I
can do trying to explain it. Look here:

http://www.allenbrowne.com/casu-17.html

Good luck,
CW



Bibi said:
Thank you! It's all trial and error for me - with more emphasis on the error
- If you have the time could you let me know what the quotation signs denote.
Then I'll never have to ask again!
Thank you

Bibi

Cheese_whiz said:
Hi Bibi,

In addition to splitting that up into two lines (as Golfinray pointed out),
you need 4 double quotation marks at the end, not just 3, and you don't need
any double (or single) quotation marks in the second line:

Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """"
Me.FilterOn = True

HTH,
CW

Bibi said:
Thank you for the response - I just can't get it to work!
Here's the afterupdate event
Private Sub Combo30_AfterUpdate()
Me.Filter = "[AmenityCategory] = """ & Me.Combo30 & """Me.filteron = true"
End Sub

Here's the combo30 row source
SELECT qAmenityCategory.AmenityCategory FROM qAmenityCategory ORDER BY
[AmenityCategory] DESC;

It does not update...no value is entered in to the combo box...any ideas
what I am missing????
Thank you for any suggestions.
Bibi


:

Put a combo on the form. Use the wizard to do that for you and select the
field you need. Right click on the combo and go to properties. In events,
click on the afterupdate event. Click the little button out to the right and
start the code builder. Type:
Me.filter = "[yourfieldtosearchon] = """ & me.combo# & """"
Me.filteron = true
The combo# will be there and will be something like combo20 or combo8

:

I need to create a form filter – I’d like to use a combo box – I have seen
this done many times but I have tried unsuccessfully for nearly a month to
get one to work – I have given up in defeat – please help – I do not write
code –
I have a table tblAmenities that describes various features of an apartment
– with categories such as appliances, flooring etc.
I would like to filter by category – the categories are from a table
_AmenityCategory – I use a query – qAmenityCategory to sort them
alphabetically. I have a datasheet form fAmenities based on a query
qAmenities – this query includes the field AmenityCategory. This is the form
where I would like to have the filtering combo box.
Can anyone help?
TIA
Bibi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top