
Help me please please help !!!!!
Sub LoadCombobox()
dim rs as new Recordset
rs.Open "LoookUpTable", adOpenForwardOnly, adLockReadOnly
With ComboBox1
do Until rs.EOF
.AddItem rs("TextField")
.ItemData(.NewItem)=rs("IdentityField")
rs.MoveNext
Loop
end with
End Sub
Or (faster)
Sub LoadCombobox()
dim rs as new Recordset, vaRS as Variant, i as Long
rs.Open "LoookUpTable", adOpenForwardOnly, adLockReadOnly
vaRS=rs.GetRows( , adBookmarkFirst, Array("TextField","IdentityField")
With ComboBox1
For i=0 to Ubound(vaRS, 2) - 1
.AddItem vaRS(0, i)
.ItemData(.NewItem) = vaRS(1, i)
Next
end with
End Sub
Quote:
> how can i do that
> > Why don't you use a combo box on your vb form, and have it list the
> records
> > from your other 'lookup' table
> > > I created a database with access 2000 and some of the fields are
scroll
> > > down(a field from another table) type how can I get that to happen in
> VB6
> > > program I need it like is because the fields are always changing
please
> > > help
> > > TIA