Can you have Stepped forms filters?????

paulmcdonnell

Ready to Help
Local time
Today, 09:18
Joined
Apr 11, 2001
Messages
167
Hi guys....

I have a continuous form with lists of companies. I want the ability to filter the form firstly by company name and then by area code. My method of filtering filters the form but from the original data i.e. it only filters from the original table data and not from the first group of filtered information. How do I get access to filter a group on one condition and then filter the results of this by another condition?

I would also like to be able to save the displayed results as an external excel file .. How would I go about this ...

Hope you guru's can help

Cheers
Paul
 
What I usually do is to put two buttons on my forms, one to "Filter Records", and the other to "Show All Records".

My combo boxes for the selection criteria are set up with code in the After Update property that does two things. One is to build a string that holds my filter criteria. For the very first combo box on the form, it's simply:

dim theFilter as String
...
thePARTNO = Me.cboPARTNO
theFilter = "[PARTNO] = '" & thePARTNO & "'"

But for later ones, I add the criteria onto the filter:
thePlant = Me.cboPlant
theFilter = theFilter & " AND [Plant] = '" & thePlant & "'"

Then, my "Filter Records" button does this kind of thing:
If theFilter <> "" Then
DoCmd.ApplyFilter , theFilter
theFilter = ""
End if

And the "Show All Records" button is:
' Clean up the combo boxes
Me.cboPARTNO = Null
Me.cboPlant = Null
Me.cboPARTNO.Requery
Me.cboPlant.Requery
' Show everything
DoCmd.ShowAllRecords

Do you always want to put the results to Excel, or could you give the users an option to do this?
 
Cheers for that Chris,

I want to give the user the opportunity to save to excel should they want to, so that they can keep an external record which can be used for other analysis options.

Thanks
Paul
 
Two alternatives for Excel...

One is to give the user two form buttons, one for Excel, one for results to the screen, and code each accordingly.

But, what if you built a toolbar with the "Analyze it with MS Excel" function on it and put that up when you display the results? Then the user could look at what they've got before they decide...
 

Users who are viewing this thread

Back
Top Bottom