Solved

dbgrid and lookup

Posted on 1998-06-21
6
621 Views
Last Modified: 2010-04-04
Does anyone know how to setup a table lookup field on a DBGrid ?

i try to do  by Tfield and 4 some reasone its just not working ? (ie - i"m not getting drop down in the dbgrid )

if some one can send me and example it would be great to
b_asi@inter.net.il

10x in advance
asi


0
Comment
Question by:asi
  • 3
  • 3
6 Comments
 
LVL 3

Expert Comment

by:Matvey
Comment Utility
Hi Asi, I send you an example. Weired that it's not working - I just did the usual stuff.

In the example: "Size" has and attached drop down list with values 1-7.

Hope I got you right

Regards,
bosism@netvision.net.il
0
 

Author Comment

by:asi
Comment Utility
i did it by the pickup list this is NOT a lookup field ...

0
 

Author Comment

by:asi
Comment Utility
i meant u did it by the pick list and this is not Lookup field which mean that the value in the drop down list is taken from another table

happy fro others unswer
all the best
asi
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 3

Expert Comment

by:Matvey
Comment Utility
Uh, Sorry, I'll try to make an example with a lookup field...
0
 
LVL 3

Accepted Solution

by:
Matvey earned 50 total points
Comment Utility
Hi again, I sent you another example with some lookup fields.

I also found instructions in the help, and as far as I can see they should be correct:


To create a lookup field in the New Field dialog box:

1.      Enter a name for the lookup field in the Name edit box. Do not enter the name of an existing field.
2.      Choose a data type for the field from the Type combo box.
3.      Enter the size of the field in the Size edit box, if appropriate. Size is only relevant for fields of type TStringField, TBytesField, and TVarBytesField.
4.      Select Lookup in the Field type radio group. Selecting Lookup enables the Dataset and Key Fields combo boxes.
5.      Choose from the Dataset combo box drop-down list the dataset in which to look up field values. The lookup dataset must be different from the dataset for the field component itself, or a circular reference exception is raised at run time. Specifying a lookup dataset enables the Lookup Keys and Result Field combo boxes.

6.      Choose from the Key Fields drop-down list a field in the current dataset for which to match values. To match more than one field, enter field names directly instead of choosing from the drop-down list. Separate multiple field names with semicolons.
7.      Choose from the Lookup Keys drop-down list a field in the lookup dataset to match against the Source Fields field you specified in step 6. To specify more than one field, enter field names directly instead. Separate multiple field names with semicolons.

8.      Choose from the Result Field drop-down list a field in the lookup dataset to return as the value of the lookup field you are creating. To return values from more than one field in the lookup dataset, enter field names directly instead. Separate multiple field names with semicolons.

Hope this helps
Regards,
Matvey
0
 

Author Comment

by:asi
Comment Utility
actually , i find out myself the problem , somehow the look up field have to be long integer
and not short
i have no clue why it is hapend but it solve me the problem
any way 4 your try i"m giving u the points
all the best

asi
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now