tumby1974
Posts: 26
|
| Posted: 02/14/2012, 12:14 PM |
|
I'm trying to use the AJAX 2 dependent listbox example within a record form (instead of a search form) so you can save the listbox selections into the record's table.
however, it's only pulling the id numbers (since the dependent listboxes use the IDs in the bound column to link the listboxes/tables) so my record is only putting numbers (the IDs) into the table instead of the text.
if I make the bound columns the text fields then the listboxes can't link (be dependent on each other)
??
|
 |
 |
andy
Posts: 183
|
| Posted: 02/15/2012, 6:59 AM |
|
Good database design (cf. database normalisation) means it is a good idea to keep your lookup list in a separate table containing the actual values and only store the id field linking to the table on your form.
In order to display the actual values (rather than the id field) on your form you have a number of options:
* Use a dropdown box that stores the id field value but displays the lookup value
* If using a standard text box or a label (in a report) you can either create a database view that links the table with the lookup table and so provides you with a single data source for your form or report that acutally contains the value or
* again if using a standard text box or a label (in a report) you can base the datasource just on the table (which only contains the id field not its logical value) and use a BeforeShow event to lookup the value from the lookup table. e.g. id field = hidden, create a tag label that displays the lookup value...
Using a view is much easier!
A dropdown box is the ready made solution (storing the id field and displaying the lookup value).
Hope this helps.
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
 |
 |
|