I have a form that fills out 124 control boxes with names and then colors them based on the grouping. I'm basically creating a seating chart.
I'm runing into a problem that after the 2nd or 3rd time Load the form, it starts to take 5is minuts to run thru the code to format the chart.
I've don the trick of copying all the controls into a new form and renaming the new form the old forms name, but again after the 4th or 5th time of loading the form, ith starts to lag greatly. below is the code that populates the text boxes with the names and the colors:
~~~~~~~~~~~~~~~~~~~~~~~~~~
For seatnum = 0 To List2.ListCount - 1
Me("seat" & seatnum) = List2.ItemData(seatnum)
List2.BoundColumn = 4
redcolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 5
greencolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 6
bluecolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 7
redicolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 8
greenicolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 9
blueicolorfill = List2.ItemData(seatnum)
If Me("seat" & seatnum).BackColor <> RGB(redcolorfill, greencolorfill, bluecolorfill) Then
Me("seat" & seatnum).BackColor = RGB(redcolorfill, greencolorfill, bluecolorfill)
End If
If Me("seat" & seatnum).ForeColor <> RGB(redicolorfill, greenicolorfill, blueicolorfill) Then
Me("seat" & seatnum).ForeColor = RGB(redicolorfill, greenicolorfill, blueicolorfill)
End If
List2.BoundColumn = 3
Next seatnum
For seatnum = 0 To List3.ListCount - 1
Me("grp" & seatnum) = List3.ItemData(seatnum)
List3.BoundColumn = 3
redcolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 4
greencolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 5
bluecolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 6
redicolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 7
greenicolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 8
blueicolorfill = List3.ItemData(seatnum)
Me("grp" & seatnum).BackColor = RGB(redcolorfill, greencolorfill, bluecolorfill)
Me("grp" & seatnum).ForeColor = RGB(redicolorfill, greenicolorfill, blueicolorfill)
Me("grp" & seatnum).BorderColor = RGB(0, 0, 0)
List3.BoundColumn = 2
Next seatnum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help or advice would be apreciated
I'm runing into a problem that after the 2nd or 3rd time Load the form, it starts to take 5is minuts to run thru the code to format the chart.
I've don the trick of copying all the controls into a new form and renaming the new form the old forms name, but again after the 4th or 5th time of loading the form, ith starts to lag greatly. below is the code that populates the text boxes with the names and the colors:
~~~~~~~~~~~~~~~~~~~~~~~~~~
For seatnum = 0 To List2.ListCount - 1
Me("seat" & seatnum) = List2.ItemData(seatnum)
List2.BoundColumn = 4
redcolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 5
greencolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 6
bluecolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 7
redicolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 8
greenicolorfill = List2.ItemData(seatnum)
List2.BoundColumn = 9
blueicolorfill = List2.ItemData(seatnum)
If Me("seat" & seatnum).BackColor <> RGB(redcolorfill, greencolorfill, bluecolorfill) Then
Me("seat" & seatnum).BackColor = RGB(redcolorfill, greencolorfill, bluecolorfill)
End If
If Me("seat" & seatnum).ForeColor <> RGB(redicolorfill, greenicolorfill, blueicolorfill) Then
Me("seat" & seatnum).ForeColor = RGB(redicolorfill, greenicolorfill, blueicolorfill)
End If
List2.BoundColumn = 3
Next seatnum
For seatnum = 0 To List3.ListCount - 1
Me("grp" & seatnum) = List3.ItemData(seatnum)
List3.BoundColumn = 3
redcolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 4
greencolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 5
bluecolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 6
redicolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 7
greenicolorfill = List3.ItemData(seatnum)
List3.BoundColumn = 8
blueicolorfill = List3.ItemData(seatnum)
Me("grp" & seatnum).BackColor = RGB(redcolorfill, greencolorfill, bluecolorfill)
Me("grp" & seatnum).ForeColor = RGB(redicolorfill, greenicolorfill, blueicolorfill)
Me("grp" & seatnum).BorderColor = RGB(0, 0, 0)
List3.BoundColumn = 2
Next seatnum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help or advice would be apreciated