combo box relying on a check box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am pretty new to Access and have encountered a few problems. I want to have a check box in this from to see if the user would only like to use the standard colours, then a combo box listing colours (all or just standard) based on the check box

At the moment I have 2 tables TB LABEL COLOURS and LABEL SCHEDULE

In TB LABEL COLOURS there are 2 fields of note, LABEL COLOUR (text) and NILSEN STANDARD (yes/no). And LABEL SCHEDULE where the data is being written to

Should I have 3 tables, splitting the standard and non-standard colours

I have tried IF, THEN clauses and SELECT and much else but no joy. maybe i'm just getting the syntax wrong

There is probably a very simple solution to all this but my brain is fried

Any help at all would be gratefully recieve
thanks in advanc

Mar
 
If I have understood your problem correctly, you wish the
combo box dropdown list to be populated diffently according
to the setting of the check box.

If so, you need to change the RowSource SQL dynamically, so
I suggest you put the following code in the check box's
AfterUpdate event handler

If {yourCheckBoxName} Then
{yourComboBoxName}.RowSource = "SELECT [LABEL COLOUR]
FROM [TB LABEL COLOURS]"
Else
{yourComboBoxName}.RowSource = "SELECT [LABEL COLOUR]
FROM [TB LABEL COLOURS] WHERE [NILSEN STANDARD]"
End If

The above assumes that you users will tick the check box to
get all the colours listed. If you want them to tick the
box to get standard colours only, then you will need to
switch the two statements setting the RoqSource.

You will need to replace the {yourCheckBox} and
{yourComboBox} with your own names.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I am pretty new to Access and have encountered a few
problems. I want to have a check box in this from to see
if the user would only like to use the standard colours,
then a combo box listing colours (all or just standard)
based on the check box.
At the moment I have 2 tab {yourCombBoxName}.RowSource
= "SELECT [LABEL COLOUR] FROM [TB LABEL COLOURS]"
les TB LABEL COLOURS and LABEL SCHEDULE.
In TB LABEL COLOURS there are 2 fields of note, LABEL
COLOUR (text) and NILSEN STANDARD (yes/no). And LABEL
SCHEDULE where the data is being written to.
Should I have 3 tables, splitting the standard and non-standard colours?

I have tried IF, THEN clauses and SELECT and much else but
no joy. maybe i'm just getting the syntax wrong.
 
Thanks a heap Gerald you're a lifesaver. i had the right idea but the syntax all wron
it should provide for some usefull base other apects of thi databas

thanks agai

Mark
 
Back
Top