Limit a field to user defied values depending on the input of another field.

mattcdse

Registered User.
Local time
Today, 08:44
Joined
Nov 23, 2005
Messages
42
Hey all,

I have two fields 1 & 2

field 1 is a simple combo list of user defined values ie A, B, C or D

Field 2 relates to a attribute of the data in field 1 and is not always the same for A, B, C and D. i.e

A could have a,b,c,d or e
B could have c,e,f,g or h
C could have a,g,h,i or j
D could have v,w,x,y or z

I would field 2 to have a combo box which only displays a,b,c,d, or e when A is chosen in field 1; c,e,f,g or h when B is chosen; etc

How do I do this?

Cheers all,

Matt :confused:
 
If the 2nd field is a cbo then it must have a qry or a sql as the record source. Either way, click the build button next to it while viewing the properties for that field and it will open the QBE. Once there you can right click in the column that has the filed holding the A,B,C ect data and select build from the criteria row. There are plenty of samples of this already on the site....

Basicly you'll be adding a where clause to the sql for the 2nd cbo that matches the 1st cbo's data in the form.
 
Ok, that's cool, I understand all that, the code is where I'm stuck, like I need to know how to refer to the specific value in the chosen recored. Select seems nice, but i can only find

I'm sure there are hundred of examples of code here, but that's just it, there so many I don't have time to look through them all to find the perfect match. If anyone knows of any useful bit of code, please reference them. I don't expect anyone to do the searching for me, but any nice tit bits of code would make me very greatful.

Thanks all,

Matt
 

Users who are viewing this thread

Back
Top Bottom