A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

LookUp Values That Depend on Previous Column



 
 
Thread Tools Display Modes
  #1  
Old January 18th, 2005, 10:17 PM
Simula67
external usenet poster
 
Posts: n/a
Default 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  
Old January 18th, 2005, 10:30 PM
Rick B
external usenet poster
 
Posts: n/a
Default

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  
Old January 19th, 2005, 02:00 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old January 21st, 2005, 09:09 PM
Simula67
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.