If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Using Combo Boxes
Hi,
I have 2 tables; 1. Demo: ID, LastName, FirstName (fields in the table Demo) ID is the Primary key. 2. Orders: Last Name, First Name, NoOfOrders ....... I chose Last Name and First Name as the primary fields because I want the users of this application, be able to select the Names from a combo box instead of selecting their ID's. Here I have 2 problems, 1. when I select Last Name in the first combo, it should filter the values in the First Name combo. ( I tried so many ways to do this, but I failed all the times) 2. And when the First Name Combo got selected, I want the SSN textbox field which is empty, should populate the correct SSN value from the first table. Please Help Thanks Praveen Manne |
#2
|
|||
|
|||
Using Combo Boxes
The problem here is that you should store only the iD in the orders. Once
you have the ID of who the order belongs to, then you don't need to copy the first name, last name, SSN, address or whatever else you want. The whole idea here is that you have a relational database. That means you only need store the id. Further, what happens if you have two people with the same name? So, while your users will NEVER see the ID, that is what you should use. If you built a combo box, it can search by last name, but store the id. So, you best to actually build the combo box that returnees id, lastName, FirstName, (and perhaps even show the SSN in the comb box.). That way, you can select whatever name you want. When you do select the name, and store ONLY that id, then all other information can be displayed on the screen..but there is NO reasons to copy the data. So, you store the id, but users NEVER see this id. I explain how to do this he http://www.attcanada.net/%7ekallal.m...000000005.html -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
Thread Tools | |
Display Modes | |
|
|