Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012

    Question Unanswered: Run-time error '13'

    Hi all,

    For months i have been using a little script in my ESRI GIS software and it has been working fine. But unfortunately when I click a button I get the error "Run-time error '13'

    Now my problem is I am not very good at debugging, but I am very good at fixing things under instruction. Is there anything that stands out in the below code?

    ' change US Manhole to lavington datum

    Private Sub CommandButton2_Click()

    USImperial = TextBox9.Text
    USExistCoverted = (USImperial * 0.3048) - 0.238
    USExistRound = Format(USExistCoverted, "###.##")

    TextBox2.Text = USExistRound

    USSL = TextBox11.Text
    TextBox11.Text = USSL - 0.238

    USSLImperial = TextBox13.Text
    USSLExistCoverted = (USSLImperial * 0.3048) - 0.238
    USSLExistRound = Format(USSLExistCoverted, "###.##")

    TextBox11.Text = USSLExistRound

    Call StatusUpdate
    End Sub

    Any suggestions or comments greatly appreciated.

    Attached Thumbnails Attached Thumbnails Clipboard01.jpg   Clipboard02.jpg  

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    at first guess I'm assuming usimperial is a control
    in which case you have to explicitly tell VB to use the value or else it tries to multiply the code not the value in the control

    so I'd try
    USExistCoverted = (USImperial.value * 0.3048) - 0.238
    USExistCoverted = (cdbl(textbox9.value) * 0.3048) - 0.238
    that assumes of course that textbox9 and or usexistcoverted has a numeric value. youmay want to check that the control is numeric before using it in a mathmatical operation

    have a look at isnumeric
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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