Filter Subform based on textbox (1 Viewer)

sigma788

Registered User.
Local time
Today, 14:04
Joined
Dec 1, 2009
Messages
40
Hello everyone,

I have researched but couldn't find any working filter criteria for subform criteria.
i have used the code, searching the web but still no luck.

I have attached the picture and sample northwind database (accdb).
i just want to filter customers in Orders navigation using text criteria.

Regards.
 

Attachments

  • all.png
    all.png
    45.9 KB · Views: 146
  • sampleDB.zip
    365.9 KB · Views: 118
Last edited:

billmeye

Access Aficionado
Local time
Today, 17:04
Joined
Feb 20, 2010
Messages
542
Hi sigma788. I've attached an updated version of your DB. I placed a control on your main form and as you type it will filter the Active Orders. It takes advantage of the Key Press event to capture what the user has typed and saves it in another hidden control that is then used in the record source for the Active Orders as the criteria for the Company field. The filter does not consider context, just exact matches found within each text string. Let me know if that will work for you. For your other subforms you will need to add the criteria.
 

Attachments

  • Northwind2010Client.zip
    369.7 KB · Views: 173

sigma788

Registered User.
Local time
Today, 14:04
Joined
Dec 1, 2009
Messages
40
Thanks billmeye.
Sorry for the delay.

Modified your sample according to my requirements and have a working sample.
Cheers:)

here is modified sample.
 

Attachments

  • working_samp.zip
    276 KB · Views: 179

sigma788

Registered User.
Local time
Today, 14:04
Joined
Dec 1, 2009
Messages
40
I was wondering if it is possible to filter customer with order total greater than x amount (currency) in active orders forum.
 

billmeye

Access Aficionado
Local time
Today, 17:04
Joined
Feb 20, 2010
Messages
542
Are you looking for a permanent filter or a temporary filter? Have you tried using the Filtering capabilities that are built in Access, i.e, select any of the Order Total fields, right click and select Filter?
 

Attachments

  • FilterExample.jpg
    FilterExample.jpg
    93.2 KB · Views: 155

sigma788

Registered User.
Local time
Today, 14:04
Joined
Dec 1, 2009
Messages
40
just a temporary filter like the above customer name filter .
 

billmeye

Access Aficionado
Local time
Today, 17:04
Joined
Feb 20, 2010
Messages
542
Because you are dealing with numbers, it doesn't quite work the same since you have to wait until the user has finished entering the number. You could set it up just like Microsoft's default that you referenced in the beginning of your post which has the blank field, button to perform the filter and a button to clear the filter but then you would also need to reference greater than, equal to or less than since you never know you may want that flexibility.

Are you sure the built in Filtering options like I showed in the jpg won't be sufficient? Let me know after you've tried.
 

sigma788

Registered User.
Local time
Today, 14:04
Joined
Dec 1, 2009
Messages
40
tried to use numbers using the filter instead of customer name but it was NOT quite stable.

I was not aware of the the option in the picture and will be a quick alternative.

But i will really appreciate an temporary order total filter with greater than like the above customer name filter.(if possible).

Regards.
 

billmeye

Access Aficionado
Local time
Today, 17:04
Joined
Feb 20, 2010
Messages
542
Sigma788 next filter is on you. Here is a basic filter for your Order Totals. Please take a look at the VBA. One thing you always need to guard against is invalid data that results in an error. Incompatible data types is a common problem, you never know what your users will do.
 

Attachments

  • Northwind2010Client.zip
    277.1 KB · Views: 146

sigma788

Registered User.
Local time
Today, 14:04
Joined
Dec 1, 2009
Messages
40
Thanks billmeye again.
This will definitely do.
Sure Incompatible data types are problem while filtering data.

Regards.
 

Users who are viewing this thread

Top Bottom