Filter Subform based on textbox

sigma788

Registered User.
Local time
Yesterday, 16:12
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: 219
  • sampleDB.zip
    sampleDB.zip
    365.9 KB · Views: 195
Last edited:
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

Thanks billmeye.
Sorry for the delay.

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

here is modified sample.
 

Attachments

I was wondering if it is possible to filter customer with order total greater than x amount (currency) in active orders forum.
 
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: 225
just a temporary filter like the above customer name filter .
 
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.
 
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.
 
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

Thanks billmeye again.
This will definitely do.
Sure Incompatible data types are problem while filtering data.

Regards.
 

Users who are viewing this thread

Back
Top Bottom