filter form (1 Viewer)

arturreter

Registered User.
Local time
Today, 06:51
Joined
Sep 8, 2013
Messages
15
Hi,

I've been looking for the answer for a long time now, so please help.

I have a form with over 50000 clients. Each client has a unique personal ID like 000154225, 002254653 ect.

I often have a list of 20 or more personal IDs and I want to filter my form to display only whose 20 clients.

Is there a way to do that. I need a form to show me those clients, because of many combo boxes with important information in it.
 

Mihail

Registered User.
Local time
Today, 16:51
Joined
Jan 22, 2011
Messages
2,373
Your DB seems to not be normalized.

A solution is to hard code:
Me.Filter = "IDfieldName = 000154225 OR IDfieldName = 002254653 OR........"
Me.FilterOn = True
 

arturreter

Registered User.
Local time
Today, 06:51
Joined
Sep 8, 2013
Messages
15
Thanks, but that's not a solution i've been looking for...
 

Mihail

Registered User.
Local time
Today, 16:51
Joined
Jan 22, 2011
Messages
2,373
Can't you "construct" the filter ?
Something like this (pseudo-code, of course):

Code:
Dim strFilter As String

  strFilter = ""
For Each Item in MyList
  strFilter = strFilter & " OR " & Item
Next item

'Remove first OR
strFilter = Mid(strFilter,5)

'Apply the filter
Me.Filter = strFilter
Me.FilterOn = True
I assumed that your list is in an electronic format
While you don't say us more about your issue, I don't think that someone can help you too much.

Cheers
 

robertbwainwright

Registered User.
Local time
Today, 08:51
Joined
May 2, 2012
Messages
62
Hi,

I've been looking for the answer for a long time now, so please help.

I have a form with over 50000 clients. Each client has a unique personal ID like 000154225, 002254653 ect.

I often have a list of 20 or more personal IDs and I want to filter my form to display only whose 20 clients.

Is there a way to do that. I need a form to show me those clients, because of many combo boxes with important information in it.

An easy way to do this would be create a copy of your form and create another table for your list. In your data source for the copied form simply join the table with your list. You could create a form that opens to edit your list.
 

Mihail

Registered User.
Local time
Today, 16:51
Joined
Jan 22, 2011
Messages
2,373
An easy way to do this would be create a copy of your form and create another table for your list. In your data source for the copied form simply join the table with your list. You could create a form that opens to edit your list.
This idea is:

  1. If the new table is a temporary table created each time you need it, this can be a good idea. But why to create a table when you can create a query ? And, if you choice to create either a query or a table you need... a filter. So, the circle is closed. (And is no need to create a copy of your form. Just use VBA to change the Record Source of the form you already have.)
  2. If the new table is a permanent table where to store only this clients, then this idea is VERY BAD.
 

Users who are viewing this thread

Top Bottom