Toggling various sub-forms

tstarkie

Registered User.
Local time
Today, 15:16
Joined
Jun 6, 2012
Messages
11
Hi All, I've read various posts relating to toggle buttons but just can't seem to be able to find the answer I'm looking for - either that or I'm just being that stupid! :banghead: So really hoping someone could please help out.

I have a customers form which has a tab control within it for displaying various parts of the customer's account; one tab holds purchase information in it from a datasheet. But I now need a way to be able to view different categories of said purchases within the same form, so I thought I'd try out some toggle buttons, each showing a different subform/report of data - so for example, say I were selling fruit, and wanted to display each type of fruit by category, I could have a list of toggle buttons along the side saying things like "Apples", "Citrus" etc. and when I clicked on the category I wanted to view, the subform/report to the right would change to show the filtered purchase data... Sounds simple in my head, but I can't get the damn thing to work :(

I realize I'll have to create various sub-forms/reports and also filter queries for each category, that's not a problem, I just can't get the toggle button part to function at all, can anyone give any suggestions as to where I might be going wrong?

Thankyou :)
 
The correct advice here depends on the specific circumstances, which aren't really clear. If we're talking about "categories" of products/items/whatever that all have the same basic set of attributes that are stored in the same table, and you just need to filter the results, that's one thing.

On the other hand, if the "categories" are of items with different sets of attributes stored in separate tables, and you need to actually change the record source of the subform, that would require different advice.
 
Hi Sean - Thanks for responding...

The data will all be in one table, and I'll just need the various toggle buttons to alternate which categories from that table to show in a list/report on the page.

I hope this makes better sense? Thanks again.
 
In that case you could just apply different filters to the record set depending on which toggle button was selected. Let's suppose you have an option group on your form with toggle buttons like the following;

Code:
[U]Button Name[/U]     [U]Value[/U]
Category 1        1
Category 2        2
Category 3        3
All Records       4

Then in the After Update event of the option group you might have code like the following;

Code:
With Me
    Select Case .ogpMyGroup
        Case 1
            .Filter = "[Category] = 1"
            .FilterOn = True
        Case 2
            .Filter = "[Category] = 2"
            .FilterOn = True
        Case 3
            .Filter = "[Category] = 3"
            .FilterOn = True
        Case 4
            .FilterOn = False
    End Select
End With
 

Users who are viewing this thread

Back
Top Bottom