Results 1 to 3 of 3

Thread: visual basic 2010 coding related question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2011
    Posts
    22

    visual basic 2010 coding related question

    hi everyone i am making a program on visual basic 2010 and i need some quick help, part of my objective is to calculate the tax, i am trying to calculate the TAX so this is part of my code and this is the only part which gives me errors:
    Code:
    Const decNetAdultTicketSales_TAX_RATE As Decimal = 0.2D
    
     ' Calculate the Net Adult Ticket Sales
    
                decNetAdultTicketSales_TAX_RATE = decGrossAdultTicketSales *
                                                          decNetAdultTicketSales_TAX_RATE
                lblNetAdultTicketSales = decNetAdultTicketSales_TAX_RATE.ToString("c")
    my problem is i am getting these 2 erroes in the lines u see on my code:
    1. Constant cannot be target of an assignment
    2. value of type 'string' cannot be converted to 'System.windows.forms.Lebel'.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: visual basic 2010 coding related question

    try this:

    vb Code:
    1. Const decNetAdultTicketSales_TAX_RATE As Decimal = 0.2D
    2.  
    3. ' Calculate the Net Adult Ticket Sales
    4.  
    5. lblNetAdultTicketSales.text = (decGrossAdultTicketSales + (decGrossAdultTicketSales * decNetAdultTicketSales_TAX_RATE
    6. )).ToString("c")
    Last edited by .paul.; Jun 12th, 2011 at 07:18 PM.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2011
    Posts
    22

    Re: visual basic 2010 coding related question

    thanks for help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width