If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Run-time error '13'

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-12, 19:04
ben_vk ben_vk is offline
Registered User
 
Join Date: Apr 2012
Posts: 1
Question 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.

Thanks
Attached Thumbnails
Run-time error '13'-clipboard01.jpg   Run-time error '13'-clipboard02.jpg  
Reply With Quote
  #2 (permalink)  
Old 04-17-12, 02:58
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 10,511
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
Code:
USExistCoverted = (USImperial.value * 0.3048) - 0.238
or
Code:
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Tags
esri, microsoft, microsoft visual basic

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On