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
|
|||
|
|||
LookUp Values That Depend on Previous Column
In my table, I have one column that contains a list of values to choose from.
In the next column, I want another list of values. But the values depend on the value chosen in the first column. For example: Column1: choose A, B, or C Column2: if A, then choose 1, 2, or 3 if B, then choose 4, 5, or 6. How would I set this up in the Design View? -- "Nirvana is here. It's our minds that are elsewhere." |
#2
|
|||
|
|||
PLEASE SEARCH BEFORE POSTING!!!!
VERY COMMON QUESTION Look for "cascading combo". You will probably find three or four posts from today alone. "Simula67" wrote in message ... In my table, I have one column that contains a list of values to choose from. In the next column, I want another list of values. But the values depend on the value chosen in the first column. For example: Column1: choose A, B, or C Column2: if A, then choose 1, 2, or 3 if B, then choose 4, 5, or 6. How would I set this up in the Design View? -- "Nirvana is here. It's our minds that are elsewhere." |
#3
|
|||
|
|||
On Tue, 18 Jan 2005 14:17:05 -0800, "Simula67"
wrote: In my table, I have one column that contains a list of values to choose from. In the next column, I want another list of values. But the values depend on the value chosen in the first column. For example: Column1: choose A, B, or C Column2: if A, then choose 1, 2, or 3 if B, then choose 4, 5, or 6. How would I set this up in the Design View? First off... DON'T use table datasheets for data entry. They are of very limited capability, and in particular, cannot achieve this. Secondly... get rid of ALL your Lookup fields. They do more harm than good. See http://www.mvps.org/access/lookupfields.htm for a critique. Finally, use a Form (let's call it frmMyForm) to enter your data, rather than a table datasheet. Put a combo box on it based on Column1; say it's called cboColumn1. Create a Query SELECT [Column2] FROM sometable WHERE [Column1] = [Forms]![frmMyForm]![cboColumn1] ORDER BY [Column2]; Base a second combo box, cboColumn2, on this query. You'll then need one single line of VBA code. Open the Form in design view; view the Properties of cboColumn1; on the Data tab find the AfterUpdate property and click the ... icon. Choose "Code Builder" and edit the code to Private Sub cboColumn1_AfterUpdate() Me!cboColumn2.Requery End Sub John W. Vinson[MVP] |
#4
|
|||
|
|||
Thanks for the info. I did search before posting, but it would never occur to
me to look up "cascading combo". "Rick B" wrote: PLEASE SEARCH BEFORE POSTING!!!! VERY COMMON QUESTION Look for "cascading combo". You will probably find three or four posts from today alone. "Simula67" wrote in message ... In my table, I have one column that contains a list of values to choose from. In the next column, I want another list of values. But the values depend on the value chosen in the first column. For example: Column1: choose A, B, or C Column2: if A, then choose 1, 2, or 3 if B, then choose 4, 5, or 6. How would I set this up in the Design View? -- "Nirvana is here. It's our minds that are elsewhere." |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Lookup with wrong result values | noah | Worksheet Functions | 2 | May 13th, 2004 05:56 PM |
Look up values in one column based on values in another without repeating | Frank Kabel | Worksheet Functions | 4 | April 8th, 2004 10:54 PM |
Query column for unique values | David Morrison | Worksheet Functions | 3 | March 27th, 2004 01:45 AM |
Lookup function that returns multiple values in column 2 | Ronn | Worksheet Functions | 9 | February 29th, 2004 10:19 PM |
Lookup??? | DRod | Worksheet Functions | 4 | September 22nd, 2003 08:56 PM |