Results 1 to 4 of 4

Thread: Calculations

  1. #1
    Join Date
    Aug 2004
    Posts
    82

    Exclamation Unanswered: Calculations

    HI can you tell me how I can add two variable. The problem is how to use eg

    A = Val(String as String)
    B = Val(String as String)
    if A + B = 10 then
    me.hide
    frm2.show

    ect

    WHY DOES IT SAY VARIABLE NOT DEFINED!!

    THANX IN ADVANCE

    Jwman

  2. #2
    Join Date
    Oct 2004
    Posts
    8
    Code:
    dim A as Integer
    dim B as Integer
    
    A=val(textboxa)
    B=val(textboxb)
    if a+b=10 then
      me.hide
      frm2.hide
    end if
    you just need to use the "dim" keyword to declare a variable before you can use it

  3. #3
    Join Date
    Aug 2004
    Posts
    82

    Thanx

    Thanx for that i'm quite new and making an extensive program which is proving hard. It seems so obvious now thanx for that

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    You might want to consider a book like SAMs Learn VB 6 in 24 hours. It presents VB in 24 one-hour lessons.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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