Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Creating a lookup field in a TDBGrid for Builder


How do I create a lookup field in a TDBGrid in C++ Builder   

    . Drop 2-TTable's, -TDataSource and -TDBGrid on a form.

    2. Connect Table to DataSource to DBGrid : In the object inspecter, set these attributes. a. DataSource .DataSet = Table b. DBGrid .DataSource = DataSource

    3. Setup Table : In the object inspecter for Table , set these attributes. a. DatabaseName = BCDEMOS b. TableName = Customer c. Active = True

    4. Setup Table2: In the object inspecter for Table2, set these attributes. a. DatabaseName = BCDEMOS b. TableName = Orders c. Active = True

    5. Add all of the fields for Table by bringing up the Fields Editor: a. Double click on Table b. Right click on Fields Editor c. Add Fields. Add all of them

    6. Add a new field for Table . a. Right click on Fields Editor, and select New Field.

    7. Specify the following parameters for the newly added field. a. Name: CustOrder b. Type: String c. Size: 30 d. Select Lookup e. Key Fields: CustNo - Field in Table to store value f. DataSet: Table2 - Table lookup is being done on g: LookUpKeys: CustNo - This Key gets copied to KeyField h: Result Field: OrderNo - Value to display to the user in the drop down box

    8. Run the application

    8/4/99 :54: 2 AM

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use