Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:18:41+00:00 2026-06-02T01:18:41+00:00

TDBLookupCombobox Can anyone help me to reproduce TDBLookupCombobox functionality in FireMonkey?

  • 0

TDBLookupCombobox

Can anyone help me to reproduce TDBLookupCombobox functionality in FireMonkey?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:18:44+00:00Added an answer on June 2, 2026 at 1:18 am

    I don’t know if there is a better solution but this is what i do:

    Suppose you have Table1 with a Foreign Key to Table2.

    • Make a Lookup field in Table1 using the Foreign Key.
    • Use TBindList to fill the Text property of the Combobox with the
      looked up field in Table2 and fill the Tag property with the
      Primary Key of Table2.
    • Use TBindPosition to match the selected text with the
      lookup field and Selected.Tag with the Foreign Key in Table1.

    edit:

    Check the SourceComponent property of your TBindList and TBindPosition.

    TBindList should point to the BindScopeDB of Table2.

    TBindPosition, instead, to the BindScopeDB of Table1.

    ControlComponent should point to your TComboBox for both.

    When you use TBindList, Format collection expressions refer to the single item inside the ComboBox because it cycles for every row in your Table2 to fill the control. So ControlExpressions are the properties of each item:

    Text,
    Tag

    Note: you don’t need Selected

    and these SourceExpressions:

    FieldByName(LookedUpField).AsString,
    FieldByName(PK).AsInteger

    Put these expressions in the Format collection.

    TBindPosition, instead, refers always to the whole ComboBox so you need to use Selected.
    ControlExpressions:

    Selected.Tag
    SelectedText(Self),

    SourceExpressions:

    FieldByName(FK).AsInteger,
    FieldByName(LookupField).AsString

    Remember that PosSource collection is used to set “ControlExpressions TO SourceExpressions” assignments while PosControl contains “SourceExpressions TO ControlExpressions” assignments.

    Basically you need two things: change your selected item when Table1 cursor changes and set your FK using the Tag property of the selected item when user changes it.

    So just put these in your PosControl collection:

    SelectedText(Self) ControlExpression

    FieldByName(LookupField).AsString SourceExpression

    and these in your PosSource collection:

    Selected.Tag ControlExpression

    FieldByName(FK).AsInteger SourceExpression

    If you want to make a similar behavior of TDBLookupComboBox you have to put the Table in Edit state when the selected combobox item is changed.

    When I tried Firemonkey some months ago I needed more expressions to update the same field shown in a StringGrid but I don’t know if there is a better solution for that. Hope someone else can answer and share his experience about this.

    For more informations look for the examples included with XE2.

    Hope this helped a bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone managed to get a DBLookupComboBox to work with a DBCtrlGrid ? A
I want to change the color of the dropdown items in a TDBLookupComboBox (in
I have two TDBLookupComboBox controls that I'd like to connect to the same dataset,
I am looking for a way to provide a ListSource to a TDBLookupComboBox in
I have Delphi 7 and I'm using NexusDB for the database. I have a
In this question, I asked about breaking a dataset into subsets, and got a
I have a table with a couple foreign keys, something like this: CREATE TABLE
I am trying to design a set of data controls that contain their own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.