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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
men xinCEOCommented:
jupe:

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

DBLookupComboBox1.Perform(WM_KEYDOWN,VK_DOWN,0);

menxin
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

kretzschmarCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.