R
Rod Behr
A drop-down box is assigned a list of values from an array:
Dim myArray(3, 1)
Set formPage = Item.GetInspector.ModifiedFormPages
Set ctrl = formPage("myForm").Controls("myControl")
myArray(0,0) = "Fred"
myArray(0,1) = 1
myArray(1,0) = "Jim"
myArray(1,1) = 2
myArray(2,0) = "Arnold"
myArray(2,1) = 3
ctrl.list = myArray
The control's list property is then set to the array. The control's bound
column is 2 (the integer value) and the number of columns is 1 to show the
string and not the integer value (primary key). The control is bound to a
user-defined field (myField).
Let's say I open the form, select "Arnold" and then close the form.
On re-opening, the drop-down control is blank (it's .list property is
correctly assigned, but it has no .value property). By unhiding the "All
Fields" form, I can see that the value of myField is 3, which is correct.
How do I go about getting the drop-down box to display "Arnold" when I
re-open the item?
Dim myArray(3, 1)
Set formPage = Item.GetInspector.ModifiedFormPages
Set ctrl = formPage("myForm").Controls("myControl")
myArray(0,0) = "Fred"
myArray(0,1) = 1
myArray(1,0) = "Jim"
myArray(1,1) = 2
myArray(2,0) = "Arnold"
myArray(2,1) = 3
ctrl.list = myArray
The control's list property is then set to the array. The control's bound
column is 2 (the integer value) and the number of columns is 1 to show the
string and not the integer value (primary key). The control is bound to a
user-defined field (myField).
Let's say I open the form, select "Arnold" and then close the form.
On re-opening, the drop-down control is blank (it's .list property is
correctly assigned, but it has no .value property). By unhiding the "All
Fields" form, I can see that the value of myField is 3, which is correct.
How do I go about getting the drop-down box to display "Arnold" when I
re-open the item?