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

I need help with checkboxes and calculating

P: 15
Ok, I need help with putting values of checkboxes in the code,

Heres an example of how my form wil l look like:



Ok I wanted it so The Trivium checkbox would obv equal to 50, so if I checked it, it would be selected and the price would be displayed in total price, and for the part where it says number of adults I wanted to set it so each adults would cost 5+ticket, as an example, below it shud say number of child but I forgot to rename, anyway I really am stuck with the checkbox and how to put those values in.

It's a bit messy there so il try and explain better,


I guess for the first part I would like to find out how to put values in checkboxes and calculate that price, example would be

Trivium select > Current Price in total is 50 (50 per adult), for 2 adults price would be 100, I guess the number of adults should be default 1,

Price per Child is 25


So If they selected 2 adults and 2 children the total price would be 150, if my maths is correct :)


Anyway my design is a lot bigger than that but if I can figure out how to do those few things then I should be able to do it by myself

Thanks anyway
Mar 19 '08 #1
Share this Question
Share on Google+
5 Replies


P: 15
Ok I found out a few things, just stuck on one part

If CHKtriv.Value = 1 Then
LBLtotal.Caption = "50"
Else
LBLtotal.Caption = ""
End If

How to expand this, for it to check if the adults, I think the forumula needed it

50 * Adult value = Adult Price, so it would be 50 * 4 = 200 for 4 adults, but I dont know what code I need for that.
Mar 19 '08 #2

lotus18
100+
P: 866
Ok I found out a few things, just stuck on one part

If CHKtriv.Value = 1 Then
LBLtotal.Caption = "50"
Else
LBLtotal.Caption = ""
End If

How to expand this, for it to check if the adults, I think the forumula needed it

50 * Adult value = Adult Price, so it would be 50 * 4 = 200 for 4 adults, but I dont know what code I need for that.
Add a command button, then try this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.    lblTotal.Caption=50*Val(txtNoOfAdults.Text)
  3. End Sub
Just continue...
Mar 20 '08 #3

P: 15
Ok Thanks, that small code has helped me a lot :D
Mar 20 '08 #4

P: 15
How to add currency ?
Mar 20 '08 #5

QVeen72
Expert 100+
P: 1,445
Hi,

Check this :

Expand|Select|Wrap|Line Numbers
  1. lblTotal.Caption=Chr(163) & "  " & 50*Val(txtNoOfAdults.Text)
  2.  
Regards
Veena
Mar 21 '08 #6

Post your reply

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