Allow only related values in dropdown control box

K

KevinF

I have a very simple db for tracking past purchases for an organization.
There is a Categories table and a Subcategories table.
In the Subcategories table the primary field is autonumber. then the
Subcategory field has a name for each Subcategory. Then the third field is
the Categorie ID, linked to the category ID in the Categories table.

On the input form, the user will enter info about products purchased:
Product name, Product number, quantity, etc.
There is a Categories drop down box showing all the available categories of
products purchased.

Then there is a Subcategories dropdown box. How can I limit what appears in
the subcategories dropdown box to only those subcategories that link to the
category chosen in the other box?

Thanks.
 
J

Jeff Boyce

Kevin

Search on-line for "Cascading Comboboxes", which is, I suspect, what you are
trying to accomplish.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KevinF

Thanks Jeff,

I went to the help function you suggested but I can't get the bugs out of
the VBA code they give and it's driving me nuts.

Does it need to be on four separate lines like that, or are those
underscores there just to say keep typing and DONT type the underscores? I'm
really confused.

Also, the way it appears on the screen, it's very hard to tell where there
is a space between characters and where not. and of course the VBA police
tells you there's an error but no suggestion how to fix it.

I'm sure there's an answer to this but so far I'm still frustrated.

Thanks
 
J

Jeff Boyce

Kevin

An underscore is the way to tell Access/VBA that the expression continues
onto the next line. If you type the expression all on one line, you don't
need the 'line continuation symbol' ( _ ).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KevinF

Thanks Jeff.

How do I know where there are spaces between characters and where not,
inlcuding ampersands and quote " marks? the way the characters appear in the
tutorial, it's very hard to tell.
 
K

KevinF

One other question: after the first underscore, the next two lines are
indented. Is this significant?
 
J

Jeff Boyce

Kevin

I'm not familiar with (and cannot see) what you are using.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jeff Boyce

Kevin

Not that I'm aware of -- perhaps it's to make it easier to read.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Z

zay

LOOK KEVIN F WE WOULD NOT UNDERSTAND IF YOU DO NOT SAY WHAT A DF IS.''NOT
SAYING WE DON'T KNOW''
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top