By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

select only one checkbox?

P: 26
hi all,

i have a form for Banners bounded to table "tblBanners" where the user enters the size of the banner and select one substrate out of 10. all these substrates are checkboxes.
when user selects a subtrate, it calculates the price and update the same in sub_total and calculates the GST.

if the user select more than one, i want access to display message saying, "too many entries. please select only one substrate".

as of now, i wrote the code where it caluclates the price for all selected subtrates. but i want the user not to select more than one substrate.

could anyone help me in this regard?

regards,
Asle
Oct 18 '07 #1
Share this Question
Share on Google+
11 Replies


JustJim
Expert 100+
P: 407
hi all,

i have a form for Banners bounded to table "tblBanners" where the user enters the size of the banner and select one substrate out of 10. all these substrates are checkboxes.
when user selects a subtrate, it calculates the price and update the same in sub_total and calculates the GST.

if the user select more than one, i want access to display message saying, "too many entries. please select only one substrate".

as of now, i wrote the code where it caluclates the price for all selected subtrates. but i want the user not to select more than one substrate.

could anyone help me in this regard?

regards,
Asle
If you use an option group instead of a bunch of check boxes you will soon be flying!

Good Luck

Jim
Oct 18 '07 #2

P: 26
If you use an option group instead of a bunch of check boxes you will soon be flying!

Good Luck

Jim

thanks Jim... i havnt tried Option group before.
i will check it out.

regards,
Asle
Oct 18 '07 #3

P: 26
thanks Jim... i havnt tried Option group before.
i will check it out.

regards,
Asle
Hi,

I tried using option group but i want to keep 27 checkboxes.
Option groups does not allow more than 20.

Can this be done programmtically?

i want it such a way that, as user selects a substrate, its price must be added into the TOTAL field. when he deselect, the TOTAL must be '0'. Also,Access must prompt a message saying "too many entries" when the checkbox count is more than 1.

Can anyone help me in this regard,?

thanks,
Asle
Oct 22 '07 #4

JustJim
Expert 100+
P: 407
Hi,

I tried using option group but i want to keep 27 checkboxes.
Option groups does not allow more than 20.

Can this be done programmtically?

i want it such a way that, as user selects a substrate, its price must be added into the TOTAL field. when he deselect, the TOTAL must be '0'. Also,Access must prompt a message saying "too many entries" when the checkbox count is more than 1.

Can anyone help me in this regard,?

thanks,
Asle
I didn't know that about option frames!
You could use two option frames with one clearing the other or...

If you put code in each checkbox's AfterUpdate event to make all the other checkboxes = False you will only ever have one checkbox ticked. You could put manipulate the Total field at the same time, or wait until the selection is finalised.
e.g
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check00_AfterUpdate()
  2. If Me.Check00 = True Then
  3.     Me.txtTotal = 15    '   Value for this substrate
  4.     Me.Check01 = False
  5.     Me.Check02 = False
  6.     '....
  7.     Me.Check27 = False
  8. End If
  9. End Sub
Jim
Oct 22 '07 #5

P: 26
thanks Jim...

i thought of using AfterUpdate event for every check boxes.

reckon the code is gonna be really big... hahaha...

thanks a lot for your quick response mate.

will head on with AfterUpdate, as you said.

chuz,
Asle
Oct 22 '07 #6

JustJim
Expert 100+
P: 407
thanks Jim...

i thought of using AfterUpdate event for every check boxes.

reckon the code is gonna be really big... hahaha...

thanks a lot for your quick response mate.

will head on with AfterUpdate, as you said.

chuz,
Asle
It will be big, but with judicious copying and pasting and searching and replacing, it should go rather quickly.

No worries on the speedy reply, most of the rest of the people on TSDN are asleep while I'm at work here Down Under.

Jim
Oct 22 '07 #7

P: 26
It will be big, but with judicious copying and pasting and searching and replacing, it should go rather quickly.

No worries on the speedy reply, most of the rest of the people on TSDN are asleep while I'm at work here Down Under.

Jim
hey Jim,

I wrote the whole code..(ofcourse with judicious copying and pasting..lol )

it is working now... thanks mate... u saved my day...

and yeah, sometime 2day, am gonna buy a new car, Toyato Camry later this evening...

chuz,
Asle
Oct 22 '07 #8

JustJim
Expert 100+
P: 407
hey Jim,

I wrote the whole code..(ofcourse with judicious copying and pasting..lol )

it is working now... thanks mate... u saved my day...

and yeah, sometime 2day, am gonna buy a new car, Toyato Camry later this evening...

chuz,
Asle
Glad to be of assistance.
Oct 22 '07 #9

missinglinq
Expert 2.5K+
P: 3,532
Actually, for future reference, the Options Group Wizard lied to you! He's just too lazy to add more than 20 options to the group, but you can manually add more! The Forms Wizard is the same way; he'll only add so many controls to a form, but you can add many more doing it manually thru Design View!

You can create a check box, option button, or toggle button outside an option group then add it to an option group, but you have to follow these instructions to the letter!

You have to cut and paste the control (if you drag an existing control into a group frame, the control doesn't become part of the option group!)



  1. Cut the new control.
  2. Click on the Option Group frame to select it.
  3. Now, go to Edit on the menu bar and click on Paste (You have to do this from the Edit menu, you cannot do it by right clicking and then using Paste!)
Now, go to the control's Properties box and change the OptionValue property from -1 to the value that you want the option group to have when you click the control.

Now the new control is part of the group and functions just like the rest of the options in the group.

Linq ;0)>
Oct 22 '07 #10

JustJim
Expert 100+
P: 407
Actually, for future reference, the Options Group Wizard lied to you! He's just too lazy to add more than 20 options to the group, but you can manually add more! The Forms Wizard is the same way; he'll only add so many controls to a form, but you can add many more doing it manually thru Design View!

You can create a check box, option button, or toggle button outside an option group then add it to an option group, but you have to follow these instructions to the letter!

You have to cut and paste the control (if you drag an existing control into a group frame, the control doesn't become part of the option group!)



  1. Cut the new control.
  2. Click on the Option Group frame to select it.
  3. Now, go to Edit on the menu bar and click on Paste (You have to do this from the Edit menu, you cannot do it by right clicking and then using Paste!)
Now, go to the control's Properties box and change the OptionValue property from -1 to the value that you want the option group to have when you click the control.

Now the new control is part of the group and functions just like the rest of the options in the group.

Linq ;0)>
Fascinating, thanks for that, Linq. I hope I'll never need more than 20 buttons in an option group but I would have believed that lazy Rincewind of a wizzard if it told me 20 was the limit!

The stuff you learn on this site!!

Jim
Oct 22 '07 #11

missinglinq
Expert 2.5K+
P: 3,532
27 checkboxes is an awful lot. I probably would have just used a combobox, but everybody's got their own style!

Linq ;0)>
Oct 22 '07 #12

Post your reply

Sign in to post your reply or Sign up for a free account.