grivers
Posts: 28
|
| Posted: 06/30/2006, 6:00 AM |
|
I have a grid that shows data from table1. that table contains a user id number against every record. The user id and the real name of the person is stored in table2. I want to show the results from table 1 with the real name of the person where the user id is currently shown. How do I link the tables together to show the user name please?
|
 |
 |
WKempees
|
| Posted: 06/30/2006, 8:18 AM |
|
In the grids properties.
DataSource, press the elipses to go to VQB (VisualQueryBuilder)
That will show you the current SQL for your grid.
Probably SELECT * from table1 WHERE .....
In the Table definition press add table, select table 2
Check the Realname field to be included in the SELECT
Draw a relationship between T1 and T2, Table2.user_id = Table1.user_id
Using the names that are appropriate in your situation.
Close VQB by pressing OK, or press View result to see what you have done.
Back in the Designer you can now place the Realname in the grid.
Walter
|
|
|
 |
grivers
Posts: 28
|
| Posted: 06/30/2006, 9:22 AM |
|
Ah I was just missing the fact I had to place the realname label in the grid in design mode.
Thanks v much
|
 |
 |
marcwolf
Posts: 361
|
| Posted: 07/01/2006, 7:38 PM |
|
Hi there grivers
Sometimes you might have an issue with this if you using an editable grid and you still want to to the same principle.
Your can use the onbeforeshowrow to get the values of the userid from a field and then display the name in a label using a ccdlookup
As label does not create any code in the database update sections its safe to use.
Hope this helps
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |