DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    4

    Problem with Long Converstion

    Code:
    Dim intText1 As Long
            Dim intText2 As Integer
            Dim intText3 As Long
            intText1 = Val(Frm3.TextBox1.Text) 'Here is says  Conversion from string "" to type 'Long' is not valid.        
    intText2 = Val(Frm3.TextBox2.Text)
            intText3 = CStr(Val(Frm3.TextBox1.Text) * Val(Frm3.TextBox2.Text))
            Frm3.TextBox3.Text = intText3
    THE BOLD part is where it points to giving me a Invalid conversion error.

  2. #2
    Join Date
    Apr 2004
    Posts
    50
    Have you tried
    intText1 = Ctype(Frm3.TextBox1.Text, Long)

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    This works for me:
    Dim intText As Long = CType(Val(""), Long)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  4. #4
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    What is the value of Frm3.TextBox1.Text? Use the debugger...
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Similar Threads

  1. Change NT service config (disabled -> enabled)
    By pavel in forum VB Classic
    Replies: 0
    Last Post: 10-17-2001, 08:06 PM
  2. verify local admin
    By Patrick Comeau in forum VB Classic
    Replies: 6
    Last Post: 03-22-2001, 10:50 PM
  3. Problems with NetAddUser
    By Jeff Morgan in forum VB Classic
    Replies: 2
    Last Post: 02-13-2001, 10:49 AM
  4. Adding New NT User Account
    By John Whitney in forum VB Classic
    Replies: 2
    Last Post: 02-01-2001, 11:15 PM
  5. Trying to print a PDF File from VB
    By Kunal Sharma in forum VB Classic
    Replies: 2
    Last Post: 04-25-2000, 03:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links