PDA

View Full Version : Solved: Access 2003 and checkboxes



OhGorgeous1
05-18-2009, 03:43 AM
Hi All

I have an Access 2003 form which has checkboxes on it, I want to be able to select more than one checkbox (as one would expect to be able to do with checkboxes, otherwise you would use radio bouttons!)

I have one field in the database assigned to each checkbox (5 checkboxes = 5 individually names fields) this works ok but I now need to convert the -1 to some text and back the other way if the form needs updating in anyway.

Can anyone please help

OBP
05-18-2009, 04:21 AM
I am not quite sure what you are doing with the 5 checkboxes with 5 presumably matching Fields, why do you need that?
Why do you need the Conversion?
It is fairly straightforward to do if the Text is going in to the text field, is that what you want to do?

OhGorgeous1
05-18-2009, 04:55 AM
I am not quite sure what you are doing with the 5 checkboxes with 5 presumably matching Fields, why do you need that?
Why do you need the Conversion?
It is fairly straightforward to do if the Text is going in to the text field, is that what you want to do?

I don't need them! my life would be so much easier to do this a different way, but the powers that be want to have tick boxes.

If you can suggest another way of doing this I would be grateful, the form in question is frmMainForm

Database is now attached

OBP
05-18-2009, 05:00 AM
Ok, so where do they want the Tick boxes?
Is it in the Frames?, if so then you just need 3 fields to store the Frame result in, in the table.

PS I like the database, it has some nice features.

OhGorgeous1
05-18-2009, 05:34 AM
PS I like the database, it has some nice features.

thank you :)

On the frmMainForm on the second tab there are two sections that currently have checkboxes, the top ones are in a frame the bottom ones are individual checkboxes to individual fields. These are the two that need to have multiple options on them.

OBP
05-18-2009, 06:39 AM
Can you name them for me please?
What Options do they need?
Do they need to be able to select more than option at a time?

OhGorgeous1
05-18-2009, 07:01 AM
Can you name them for me please?
What Options do they need?
Organisation Type with options (OrgType in database - tblIndividual)

Any; Acute; Mental Health; Primary Care; Ambulance; SHA; Foundation; Other

Are they or have they ever been registered with any of the following: (RegBody; RegBody1.... in database tblIndividual)


General Medical Council; Health Professions Council; Nursing and Midwifery Council; General Osteopathic Council.....
Do they need to be able to select more than option at a time?

Yes

The rest of the form is sorted and working wonderfully.

OBP
05-18-2009, 07:42 AM
The multi select Regbody should really be a Sub Table in it's own right, it is not good design to have it as different fields in the same table.
In the same table it would make a lot more sense to name the Fields for the Organisations and have them as check boxes. However if you need to add an organisation you have to redesign the table and form.
You could use a Multi Select List Box, that would probably be better, but it doesnt use check boxes.

I don't think you can multiselect the Orgtype because it has an associated Orgsize field with it.

OhGorgeous1
05-18-2009, 08:05 AM
Strangley I went down this route originally and used a list box but no the powers that be want tick boxes (don't you just love the powers that be!!!)

We currently have e.g. Acute, Foundation that are both 3,500+ and less than 1,000 in size so the assosiation between the two is not entirely correct, but I can see where you were coming from.

Are you then saying that this is not possible and that I have to go and put my foot down (If only I could do it via the web, my life would be much easier but there is no set up for it here :()


The multi select Regbody should really be a Sub Table in it's own right, it is not good design to have it as different fields in the same table I tried this and still couldn't work out how to do the multi select bit.

OBP
05-18-2009, 08:26 AM
To do the Multiselect you would create a record for each of the options which includes the check box, so that they all get shown for each record and you can see the selected ones. You can use VBA to create the Records for you and the data is shown on a subform with it's borders and background set to transparent so that it looks part of the main form.

If you want to go down the Subtable/query/form method I can give you a hand with that.

As I said the simplest way is to name the 7 regbody fields for the General Medical Council; Health Professions Council etc and change them to check box type.

On second thoughts You can use your current Unbound check boxes and use VBA to populate your regbody fields and then use VBa to populate the Check boxes in the form's On current event, but that is a lot of work compared to changing the field names.
The real downside is if they later need another regbody added and you are not there they are stuck and that would serve them right.

OhGorgeous1
05-19-2009, 01:16 AM
If you want to go down the Subtable/query/form method I can give you a hand with that.

OBP yes please to the offer of help. I am so getting bog down with this.:banghead:

OBP
05-19-2009, 05:12 AM
OK but before we do have a look at this version where I have just used Yes/No check box fields in the table with your Organisation as their names.
It may be good enough for want you want. The only problem will be additional names/Fields later

OhGorgeous1
05-19-2009, 05:19 AM
I have had a look and this looks like it might work perfect (at least it will keep the powers that be happy).



It may be good enough for want you want. The only problem will be additional names/Fields later I don't think these will change but I am sure if they do or if they want a new one added I should be able to do that.

Thank you so much for your help on this, it is gratefully appriciated.:yes

OBP
05-19-2009, 05:48 AM
Ok just let me know if you need anything else.