IGBP
01-02-2004, 10:09 PM
Hi everyone ...
I am dynamically adding Option buttons based on the result of a database query, and I am ending up with 1 extra control and it is the first record again :confused:
Here is the important code....
Do Until MyRS.EOF
strName = MyRS.Fields.Item("CompanyName").Value
Option1(i).Caption = strName
Load Option1(i + 1)
With Option1(i + 1)
.Top = Option1(i).Top + Option1(i).Height + 10
.Left = Option1(i).Left
.Visible = True
.Value = False
End With
i = i + 1
MyRS.MoveNext
Loop
Edit: The RecordCount is correct ..(6) but I end up with 7 option buttons
I have tried
Do ..
Loop Until
Do Until
Do While
Do While NOT ....
Any ideas ?
Thanks,
Michael
I am dynamically adding Option buttons based on the result of a database query, and I am ending up with 1 extra control and it is the first record again :confused:
Here is the important code....
Do Until MyRS.EOF
strName = MyRS.Fields.Item("CompanyName").Value
Option1(i).Caption = strName
Load Option1(i + 1)
With Option1(i + 1)
.Top = Option1(i).Top + Option1(i).Height + 10
.Left = Option1(i).Left
.Visible = True
.Value = False
End With
i = i + 1
MyRS.MoveNext
Loop
Edit: The RecordCount is correct ..(6) but I end up with 7 option buttons
I have tried
Do ..
Loop Until
Do Until
Do While
Do While NOT ....
Any ideas ?
Thanks,
Michael