Oppenhiemer
Programmer
I have asked for help on this subject before and so far cannot solve the problem Im having. The problem revolves around the use of DropDownCombo boxes and how to use them.
What I want to do is not complicated at all really - and anyone who has used databases Such as Microsoft Access will be familiar with what I want to do.
For those interested - here is a link to the previous post :
thread102-292547 example I will give is theoretical - but the priniciple is valid. Lets say I have a table called Orders, when filling out the orders form - I would like to present the user with a drop-down list of values for the "CustCode".
Now in Access - this would be simplicity itself, you would simply insert a dropdown list into the form and set the "RowSource" properties to the appropriate lookup table (or query.)
In Delphi however - it is approching the most complicated thing I have ever tried to do! Perhaps I am trying to use the wrong component - but I am quite frankly at a loss.
Here is what I would intuitively do in the case I just described :
1. Insert a DropdownComboBox
2. Set the "DataSource" to point to the "Orders" Table.
3. The DataField to point the "CustNo" field in Orders Table.
Now comes the lookup part..
4. The listSource points to the Customers table
5. The ListField is the "CustNo" field in the customers table
(and this is the nightmare!)
6. The KeyField points to the CustNo (If I dont set this - I get squat appearing.)
The problem (as far as I can see) is that the KeyField is somehow supposed to link the Orders table with the Customers table ? Now as you may be creating a new order - no corresponding relationship can exist in the customers table (there may be no data in the orders table to link the 2 entities.)
Do I need to create a Lookup Field ? In in that case - how does this tie in with the scenario I just described.
As I say - this is my second post on this subject, and I would not be posting again were it not so important (giving users the utility to select from a pre-defined list of values in a database iq quite important in the whole User-Interface design I think!)
Anyway, I would really appreciate any solutions people can offer to this problem.
Cheers..
Opp.
What I want to do is not complicated at all really - and anyone who has used databases Such as Microsoft Access will be familiar with what I want to do.
For those interested - here is a link to the previous post :
thread102-292547 example I will give is theoretical - but the priniciple is valid. Lets say I have a table called Orders, when filling out the orders form - I would like to present the user with a drop-down list of values for the "CustCode".
Now in Access - this would be simplicity itself, you would simply insert a dropdown list into the form and set the "RowSource" properties to the appropriate lookup table (or query.)
In Delphi however - it is approching the most complicated thing I have ever tried to do! Perhaps I am trying to use the wrong component - but I am quite frankly at a loss.
Here is what I would intuitively do in the case I just described :
1. Insert a DropdownComboBox
2. Set the "DataSource" to point to the "Orders" Table.
3. The DataField to point the "CustNo" field in Orders Table.
Now comes the lookup part..
4. The listSource points to the Customers table
5. The ListField is the "CustNo" field in the customers table
(and this is the nightmare!)
6. The KeyField points to the CustNo (If I dont set this - I get squat appearing.)
The problem (as far as I can see) is that the KeyField is somehow supposed to link the Orders table with the Customers table ? Now as you may be creating a new order - no corresponding relationship can exist in the customers table (there may be no data in the orders table to link the 2 entities.)
Do I need to create a Lookup Field ? In in that case - how does this tie in with the scenario I just described.
As I say - this is my second post on this subject, and I would not be posting again were it not so important (giving users the utility to select from a pre-defined list of values in a database iq quite important in the whole User-Interface design I think!)
Anyway, I would really appreciate any solutions people can offer to this problem.
Cheers..
Opp.