TDBLookupCombobox question

Normaly the Text of a DBLookupCombobox is changed by the 'arrow up' and 'arrow down' keys. How can I change the DBLookupText by the program i.e. simulate the 'arrow up' and 'arrow down' keys?
jupeAsked:
Who is Participating?
 
kretzschmarConnect With a Mentor Commented:
hi jupe,

not you, i have missed something

  With DBLookupCombobox1 Do
  Begin
   IF not(ListSource.DataSet.Eof) Then
    Begin
     DataSource.Dataset.Edit;
     ListSource.Dataset.Next;
     DataSource.Dataset.FieldByName(DataField).Value :=
       ListSource.Dataset.FieldByName(Keyfield).Value;
    End;
  End;

but menxin's solution looks good

meikl
0
 
kretzschmarCommented:
hi jupe,

try to scroll the underlying dataset
like
DBLookupCombobox1.ListSource.Dataset.next;

be sure that the datasource.dataset is in editmode

meikl

0
 
jupeAuthor Commented:
Hi meikl

I did the following:

      With DBLookupCombobox1 Do
        Begin
         IF ListSource.DataSet.Eof=False Then
          Begin
           DataSource.Dataset.Edit;
           ListSource.Dataset.Next;
          End;
        End;

Nothing happens.
What did I miss?

Thanks
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
men xinCEOCommented:
jupe:

I can give you an idea.it is very easy.

DBLookupComboBox1.Perform(WM_KEYDOWN,VK_DOWN,0);

menxin
0
 
jupeAuthor Commented:
Hi menxin

I have given the points to kretzschmar. Would like to give you 50 points, too. How can I do this?

jupe
0
 
men xinCEOCommented:
jupe:

That 's allright.
My pleasure to help you!

:-)

menxin
0
 
jupeAuthor Commented:
menxin

Thanks very much for your help. I would never have found your solution. Have a nice Sunday.

jupe
0
All Courses

From novice to tech pro — start learning today.