MarcMellor
Programmer
I am trying to use the SSTab control to display different selections of information in MSHFlexGrids from a single database using a single Adodc control. Unfortunately I cannot find a click event that recognises which of the 12 tabs is being selected so that I can attach code to change my selection from the database. What I have currently is this:
Private Sub SSTab1_Click (Previous Tab As Integer)
Select Case PreviousTab
Case 0
Adodc1.RecordSource = "SELECT(*) FROM PupilResultsData_ WHERE Module = '1'"
Adodc1.Refresh
Case 1
Adodc.RecordSource = "SELECT(*) FROM PupilResultsData_
WHERE Module = '2'"
Adodc1.Refresh
etc, etc, etc
End Select
This does work up to a point. The selection on the MSHFlexGrid changes as I shift from the Module 1 tab to the Module 2 tab. Unfortunately it seems to change it to the correct selection for the PREVIOUS tab, not the current one. "Obviously, you twit" I hear you say,"You are using Select Case PreviousTab, what do you expect." So I tried changing the code to:
Private Sub SSTab1_Click (Current Tab As Integer)
Select Case CurrentTab
etc, etc
and it does exactly the same thing!
I have tried getting round the problem by trying to use:
.........
If SSTab1.TabCaption(0) = "Module 1" Then
Adodc.RecordSource = .........etc
but this doesn't work
There's got to be a way. Any ideas anyone?
Private Sub SSTab1_Click (Previous Tab As Integer)
Select Case PreviousTab
Case 0
Adodc1.RecordSource = "SELECT(*) FROM PupilResultsData_ WHERE Module = '1'"
Adodc1.Refresh
Case 1
Adodc.RecordSource = "SELECT(*) FROM PupilResultsData_
WHERE Module = '2'"
Adodc1.Refresh
etc, etc, etc
End Select
This does work up to a point. The selection on the MSHFlexGrid changes as I shift from the Module 1 tab to the Module 2 tab. Unfortunately it seems to change it to the correct selection for the PREVIOUS tab, not the current one. "Obviously, you twit" I hear you say,"You are using Select Case PreviousTab, what do you expect." So I tried changing the code to:
Private Sub SSTab1_Click (Current Tab As Integer)
Select Case CurrentTab
etc, etc
and it does exactly the same thing!
I have tried getting round the problem by trying to use:
.........
If SSTab1.TabCaption(0) = "Module 1" Then
Adodc.RecordSource = .........etc
but this doesn't work
There's got to be a way. Any ideas anyone?