cyberbiker
Programmer
I am using the ssTab Control in VB6 and trying to create New Tabs "on the fly" I am able to create the tabs ok along with the proper captions but when I try to have the controls on tab0 appear on additional tabs. I get an illegal operation and VB shuts down.
I am fairly new at this, and although I have a couple of years programming experience with CoBOL and PL/N, this is my first VB job. I have only been with it a month and am a bit desperate for an answer before my new boss finds out I do not know how to do this.![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
The applicable code is as follows:
Please note the offending code is NOT split to multiple lines in the actual program.
Public Sub FindGroups()
intGroupCount = 0
Do Until EOF(intfile1)
strLine = ""
Line Input #intfile1, strLine
strLine = Trim(strLine)
If Left(strLine, 1) = "[" Then
lngPos = InStr(1, strLine, "]"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
strGroup = UCase(Trim(Mid(strLine, 2, (lngPos - 2))))
intGroupCount = intGroupCount + 1
frmUpdate.tabParam.Tabs = intGroupCount
frmUpdate.tabParam.TabCaption(intGroupCount - 1) = strGroup
'Next line of code is the issue when not commented out
Set frmUpdate.tabParam.Container(intGroupCount) = frmUpdate.tabParam.Container(0)
'number of tabs start at one. index of tabs start at 0
'thus intGroupCount - 1 is necessary or else would
'need 2 counters
End If
Loop 'While Not EOF(intfile1)
Exit Sub
Close #intfile1
End Sub
If the indicated line is commented out the tabs are created fine with the proper captions.
If I set a watch frmUpdate.tabParam.TabCaption(intGroupCount - 1) and intCount increment properly But if that line is in then the watch window shows as both being "1" then "2"
then "2" again then "4" then "2" again then "6" then "2" again then "8" then "2" then I receive an illegal operation
frmUpdate.tabParam.Container(0) = false in watch.
Thanks for reading this.
Terry
I am fairly new at this, and although I have a couple of years programming experience with CoBOL and PL/N, this is my first VB job. I have only been with it a month and am a bit desperate for an answer before my new boss finds out I do not know how to do this.
The applicable code is as follows:
Please note the offending code is NOT split to multiple lines in the actual program.
Public Sub FindGroups()
intGroupCount = 0
Do Until EOF(intfile1)
strLine = ""
Line Input #intfile1, strLine
strLine = Trim(strLine)
If Left(strLine, 1) = "[" Then
lngPos = InStr(1, strLine, "]"
strGroup = UCase(Trim(Mid(strLine, 2, (lngPos - 2))))
intGroupCount = intGroupCount + 1
frmUpdate.tabParam.Tabs = intGroupCount
frmUpdate.tabParam.TabCaption(intGroupCount - 1) = strGroup
'Next line of code is the issue when not commented out
Set frmUpdate.tabParam.Container(intGroupCount) = frmUpdate.tabParam.Container(0)
'number of tabs start at one. index of tabs start at 0
'thus intGroupCount - 1 is necessary or else would
'need 2 counters
End If
Loop 'While Not EOF(intfile1)
Exit Sub
Close #intfile1
End Sub
If the indicated line is commented out the tabs are created fine with the proper captions.
If I set a watch frmUpdate.tabParam.TabCaption(intGroupCount - 1) and intCount increment properly But if that line is in then the watch window shows as both being "1" then "2"
then "2" again then "4" then "2" again then "6" then "2" again then "8" then "2" then I receive an illegal operation
frmUpdate.tabParam.Container(0) = false in watch.
Thanks for reading this.
Terry