Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Delphi7 - Populating List Box From DB

  • 20-02-2008 09:54AM
    #1
    Closed Accounts Posts: 5,240 ✭✭✭


    I have a DBLookUpListBox which i want to populate with data from a field in a database. The field is in the 'Event' Table, field name is 'EventType'.

    Under the ListBox propertys i have set my dataSource to the query and then set the DataField to EventType. How do i get the list box to populate now? I would have thought once those two propertys are set it would populate automatically. Guessing im missing some line : LookUpBox.populate or something?
    Am new to delphi so any help would be appreciated :].

    Endo


Comments

  • Registered Users, Registered Users 2 Posts: 2,159 ✭✭✭dazberry


    You also need to set the ListSource property to point to your "lookup" datasource, and set the KeyField and ListField properties as appropriate.

    D.


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    Thanks dazberry, that worked.


Advertisement