I need help with checkboxes and calculating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carl2k2
    New Member
    • Mar 2008
    • 15

    I need help with checkboxes and calculating

    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
  • carl2k2
    New Member
    • Mar 2008
    • 15

    #2
    Ok I found out a few things, just stuck on one part

    If CHKtriv.Value = 1 Then
    LBLtotal.Captio n = "£50"
    Else
    LBLtotal.Captio n = ""
    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.

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by carl2k2
      Ok I found out a few things, just stuck on one part

      If CHKtriv.Value = 1 Then
      LBLtotal.Captio n = "£50"
      Else
      LBLtotal.Captio n = ""
      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
      [CODE=vb]Private Sub Command1_Click( )
      lblTotal.Captio n=50*Val(txtNoO fAdults.Text)
      End Sub[/CODE]

      Just continue...

      Comment

      • carl2k2
        New Member
        • Mar 2008
        • 15

        #4
        Ok Thanks, that small code has helped me a lot :D

        Comment

        • carl2k2
          New Member
          • Mar 2008
          • 15

          #5
          How to add currency £ ?

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            Check this :

            [code=vb]
            lblTotal.Captio n=Chr(163) & " " & 50*Val(txtNoOfA dults.Text)
            [/code]

            Regards
            Veena

            Comment

            Working...