vba access 2000

rwahdan

New member
Local time
Today, 08:04
Joined
Feb 11, 2006
Messages
9
i have a table that have quantity and i took that number and put it in a variable and then what i want is:

i want to create combobox and put in it numbers from 0 to the number i got from the table. example is if the number i got is 10 i want the combo to give me options from 0-10.
 
Code:
ComboBox.RowSourceType = "Value List"

Dim MyNum As Long
MyNum = 10

Dim MyValueList As String
Dim i As Integer
For i = 0 To MyNum
   MyValueList = MyValueList & CStr(i) & ","
Next

MyValueList = Mid(MyValueList, 1, Len(MyValueList) - 1)
ComboBox.RowSource = MyValueList
ComboBox.Requery

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom