hierachical check box question

  • Thread starter Thread starter Lim Heng Sin
  • Start date Start date
L

Lim Heng Sin

Let said i want to create multiple check box. THe check
boxs are as the following:

cbxWorldWide
cbxEurope
cbxEngland
cbxFrance
cbxAsia
cbxChina
cbxIndia
cbxJapan

When i click on cbxWorldWide, all the check box will be
automatically be check. When i click on cbxEurope, then
the cbxEngland and cbxFrance will automatically be
checked. Same for cbxAsia, when i click on cbxAsia, the
cbxChina, cbxIndia, and cbxJapan will automatically be
check. It's like the hierarchical.

My question are:
Is it appropiate to use multiplex check box to do this?
If multiplex check box is not appropriate then what others
control will allow me to do this?

Thanks
 
-----Original Message-----


Lim,

this is the right question :-) But to answer it, please describe what
are you trying to achieve? Do you use the choices as criteria
somewhere? And do you have the countries somewhere in a table?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
.
Emilia Maxim,
I'm trying to do like dynamically query. With another
additional button, user will be able to retrieve whatever
data they want according to their selection. This is the
request from my boss and is not i want to do in this way.
Of course the list is not so simple, it's a bit
complicated.

Lim Heng Sin
 
I'm trying to do like dynamically query. With another
additional button, user will be able to retrieve whatever
data they want according to their selection. This is the
request from my boss and is not i want to do in this way.
Of course the list is not so simple, it's a bit
complicated.

Lim,

If you really have to use check boxes here is some code to use in the
various AfterUpdate event procedures:

Private Sub cbxWorldWide_AfterUpdate()

With Me
!cbxEurope = True
!cbxEngland = True
'And so on for all other check boxes...
End With

End Sub

Private Sub cbxEurope_AfterUpdate()

With Me
!cbxEngland = True
!cbxFrance = True
End With

End Sub

The same for cbxAsia.

BUT:
Maybe you can see this yourself. If there will be other countries
and/or world parts in the future, you'll have to redesign the whole
form, creating new check boxes and updating all event procedures. Not
only is this difficult to maintain, but it will be a nightmare for the
user. (S)he will be at some time confused with all those check boxes.

Much better would be to use one single combo box and handle the choice
in the combo's AfterUpdate event procedure. For ex the list displayed
by the combo could look like this:

WorldWide
Asia
Europa
England
France
China
India
Japan
....

The RowSource query of the combo probably would also contain a hidden
column indicating to which world part each country belongs, like this:

WorldWide 0
Asia 01
Europa 02
England 1
France 1
China 2
India 2
Japan 2

This would be more user friendly and does not depend on which
countries actually exist in the database, it would work without
changes when further countries are being stored.

I cannot give you further help for this version because I don't know
any details as to how and where the country is stored. If there is a
lookup table with country names, I guess I'd create a table field
containing the continent number (i.e. 1 for european countries, 2 for
asians etc.)

Maybe you can convince your boss and use the better solution :-)

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Back
Top