Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comboz

Status
Not open for further replies.

savok

Technical User
Jan 11, 2001
303
AT
How can i set it so I can select fields in the combo box but could not enter anything? If i set Locked property to true it doesnt let me select the fields only view them.


Also if I load the combo with an index, how can i then set the value of the combo box to what ever index I have.

Combo.AddItem Rec!Name
Combo.ItemData(Combo.NewIndex) = Rec!NameID

lets say my ID was 15, how would I set the value of the combo box to the name which has the index of 15?

thanks.
 
For the first part, set the style to 2 (I forget the name, but it disallows the user from being able to enter text in the text portion).

For the second part, you would need a loop
Pseudocode:
Code:
flag = false
for i=1 to <cmb.number of items>
  if <search for> = <cmb.itemdata(i)> then
     flag = true
     exit for
  end if
end loop
if flag then 
   <do stuff>
end if

Hope that helps. =)
~Melissa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top