!!!!!!!!ITERESTING...........¡¡¡¡¡¡¡......DBLOOKUPCOMBOBOX

hello.....well I hava had a lot of problems with the component.dbloojupcombobox..............now I have this problem...:
I don't know how to know if the user have selected any Item.......does the component have a propierti that tell us where is the pointer of the dblookupcombobox.........at the array ()
ok ........
if a have selected the first ITEM how can I know that I have selected this ITEM


sorry i don't talk english very welll
IammeAsked:
Who is Participating?
 
rktroubledConnect With a Mentor Commented:
I think what you are looking for is the KeyValue property of the DBLookUpComboBox. This gives you the value that is actually being written to the dataset field that the control is bound to as opposed to the value being displayed to the user. To know that the field has been changed by the user, the OnChange event of the dataset field can be handled.
0
 
TheNeilCommented:
I don't know the dblookupcombobox too well but looking at the help what I'd do is this.

1. Use the OnClick event
2. Iterate through the items in the list using a FOR loop, looking for a match. When you get a match, you've got your index value

The Neil
0
 
IammeAuthor Commented:
is there any propierti that tell  me what is the index value...............?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
TheNeilCommented:
Not that I can see. That's why you'd have to do the search yourself. It's not a big job though - You know the text selected and I assume you can gain access to the list of items so you just use something like the following

iIndex := -1;
FOR iCount := 0 TO <No Items>
DO
  IF ComboBox1.Text = ComboBox1.Items[iCount]
  THEN
    iIndex := iCount;

The Neil
0
 
florisbCommented:
You can't read itemIndex (x) and with that int check the items array? (items[x])?

Weekend!

Floris.
0
 
TheNeilCommented:
I was using the standard Combobox as an example

The Neil
0
 
AttarSoftwareCommented:
For standard comboboxes,

  if( ComboBox1.ItemIndex > -1 ) then
    ShowMessage( ComboBox1.Items[ ComboBox1.ItemIndex ] ) ;

works...don't know about dbLookupComboBoxes...sorry...

Tim.
0
 
IammeAuthor Commented:
there is a littel problem.........it is not a  Tcombobox it is a
TDBLookupcombobox
is it the same????
0
 
IammeAuthor Commented:
ok ..don't worry ......but if you can help ........ok
0
 
IammeAuthor Commented:
ok ..don't worry ......but if you can help ........ok
0
 
intheCommented:
hi
maybe you can do onmouseup :

showmessage(inttostr(dblookupcombobox1.ListFieldIndex));
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.