Kristin in CT
New Member
- Joined
- Sep 5, 2006
- Messages
- 7
I have this code working fine when i run it with the debugger on or if i add a prompt after the creation of the label. I've tried a few different pieces of code and have see other code snippets that appear to do exactly what i'm doing but in some cases my TOP and left properties do not stick. Any ideas would be greatly appreciated. Here's a sample of what the code looks like...
for i = 1 to 24
Set NewLabel = TempForm.Designer.Controls.Add("forms.label.1")
extraLines = extraLines * 12
With NewLabel
.WordWrap = False
If extraLines > 0 Then .WordWrap = True
.Caption = i & ". " & SurveyQsht.Cells(2, i + 1)
.Height = 24 + extraLines
.Width = lblLen
.AutoSize = True
.Font.Name = "Verdana"
.Font.size = 10
.ForeColor = vbBlue
.Top = ctrlTopPos
.Left = 26
' MsgBox NewLabel.Top
End With
ctrlTopPos = ctrlTopPos +26
next i
for i = 1 to 24
Set NewLabel = TempForm.Designer.Controls.Add("forms.label.1")
extraLines = extraLines * 12
With NewLabel
.WordWrap = False
If extraLines > 0 Then .WordWrap = True
.Caption = i & ". " & SurveyQsht.Cells(2, i + 1)
.Height = 24 + extraLines
.Width = lblLen
.AutoSize = True
.Font.Name = "Verdana"
.Font.size = 10
.ForeColor = vbBlue
.Top = ctrlTopPos
.Left = 26
' MsgBox NewLabel.Top
End With
ctrlTopPos = ctrlTopPos +26
next i