Form Filter

M

myxmaster

Where do I look to place the following code to filter the form based
on the combobox result.


filter the form rather than navigate to the first match set the
form's
Filter and FilterOn properties:


Dim strFilter As String
strFilter = "Category = """ & Me.Combo24 & """"
Me.Filter = strFilter
Me.FilterOn = True


TIA
 
R

Rick Brandt

Where do I look to place the following code to filter the form based
on the combobox result.


filter the form rather than navigate to the first match set the
form's
Filter and FilterOn properties:


Dim strFilter As String
strFilter = "Category = """ & Me.Combo24 & """"
Me.Filter = strFilter
Me.FilterOn = True


TIA

The AfterUpdate event of the ComboBox would be one place.
 
G

Guest

Hi

Use the after update event of the combo


Dim Something As Object
Set Something = Me.Recordset.Clone
rs.FindFirst "[Category] = " & Str(Me![Combo24])
Me.Bookmark = rs.Bookmark
 
M

myxmaster

Hi

Use the after update event of the combo

Dim Something As Object
Set Something = Me.Recordset.Clone
rs.FindFirst "[Category] = " & Str(Me![Combo24])
Me.Bookmark = rs.Bookmark

--
Wayne
Manchester, England.



Where do I look to place the following code to filter the form based
on the combobox result.
filter the form rather than navigate to the first match set the
form's
Filter and FilterOn properties:
Dim strFilter As String
strFilter = "Category = """ & Me.Combo24 & """"
Me.Filter = strFilter
Me.FilterOn = True
TIA- Hide quoted text -

- Show quoted text -

Hi Wayne,
I tried this however the code stops at:

rs.FindFirst "[Category] = " & Str(Me![Combo24])
I'm wondering is this because the category column is itself a lookup
field in a table, therefore instead of showing say, "Credit" it is
reflecting it;s numerical position on the list say "1"?
 
G

Guest

Hi

I wouldn't use a lookup field in a table (have a look around this forum as
there are zillions of referecne to the problems this may cause). You may be
better using a combo (instead of the lookup field) linked/sourced from the
table (the one you are referencing in your lookup at the moment).
AfterUpdate on this new combo you could set focus to the next combo and run
the GoTo.

Ensure that you set the bound column (of the 1st comb) to the something that
means something - like the string/text name and not the placeing in a list as
this seems a bit strange to me.

Note that am not refereing to a casscading combo but simply an afer update
setfocus and run code - there is a difference.

Give it a try and let us know what happens. It may be a little extra work
but I think you will find it helpful.

Hope this helps


--
Wayne
Manchester, England.



Hi

Use the after update event of the combo

Dim Something As Object
Set Something = Me.Recordset.Clone
rs.FindFirst "[Category] = " & Str(Me![Combo24])
Me.Bookmark = rs.Bookmark

--
Wayne
Manchester, England.



Where do I look to place the following code to filter the form based
on the combobox result.
filter the form rather than navigate to the first match set the
form's
Filter and FilterOn properties:
Dim strFilter As String
strFilter = "Category = """ & Me.Combo24 & """"
Me.Filter = strFilter
Me.FilterOn = True
TIA- Hide quoted text -

- Show quoted text -

Hi Wayne,
I tried this however the code stops at:

rs.FindFirst "[Category] = " & Str(Me![Combo24])
I'm wondering is this because the category column is itself a lookup
field in a table, therefore instead of showing say, "Credit" it is
reflecting it;s numerical position on the list say "1"?
 

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