ABC RecordS

Teeboy

Board Regular
Joined
Jun 12, 2003
Messages
91
I have a simple form that displays a set of records sorted alpha. This is based on a query. Currently i just scroll through them.What i want to do is to be able to seperate the records into a b c etc in a tab control on a form. each page would be headed A, B, C.. etc. how would i do this?

regards.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,

i would make Filter-Buttons named 'A';'B''; .... and on click you set a filter like this one:

Private Sub A_Click()

'vars
Dim strFilt As String

'Name is the column to filter
strFilt = "[Name] like 'A*'"

'set filter
DoCmd.ApplyFilter , strFilt

End Sub

Then you only see all Records which are starting with A
 
Upvote 0
Why not create an unbound combobox which contains A-Z?

Then as tonnic suggested create a command button that filters on the value in the combobox.

Or write code for the change event of the combobox.

Code:
Private Sub Combo1_Change()
Dim Flt As String
    Me.FilterOn = False
    Select Case Combo1.Value
        
        Case "ALL"
            ' do nothing
        Case Else
            Flt = "Contractor Like '" & Combo1.Value & "*'"
            Me.Filter = Flt
            Me.FilterOn = True
    End Select
                        
End Sub
This uitilises a combobox with Row Source Type set to Value List and Row Source set to ALL;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z.

Change Contractor to your field name.
 
Upvote 0

Forum statistics

Threads
1,221,832
Messages
6,162,255
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top