Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Teaching self VB. Need some help

Chad711Chad711 Member Posts: 3
I am teaching myself as much as I can from reading material. This book I have focuses on Visual Basic however I'm pretty sure most of my troubles I am running into are due to me writing code in VB.NET and this book was not written using VB.NET (I think). So hope that helps you help me!

Ok I'm following a step by step process in this book for making a investment calc. Here are the errors I have when debugging.

Error 1 Name 'ErroCheck' is not declared.
[code]If ErroCheck() = 1 Then
Exit Sub
End If[/code]

Error 2 & 3 [color=Red]Character not Valid[/color] (it's the dollar sign) Why isnt this valid and what can I replace it with? The Error 3 is on this same line and it's with the 5th # sign. Error is "[color=Blue]expression is expected[/color]".
[code]txtEnding.Text = Format(curInitInv * sngInterest, ""[color=Red]$[/color]###,[color=Blue]#[/color]#0.00"")[/code]

Error 4, 5 & 6 "Name 'intPress' is not declared". What does that mean and how do I fix it? I'm guessing this si because I am trying to do this in VB.NET??

[code] intPress = MsgBox("Enter a value for the rate", vbCritical)[/code]


  • Chad711Chad711 Member Posts: 3
    Sweet! I figured this all out myself! Took awhile but some googling helped and some of it I just figured out on my own. So rewarding when you figure it out yourself! =D

    This first one was just a stupid typo! :/
    [code]If ErroCheck() = 1 Then
    Exit Sub
    End If[/code]

    Second one I fixed by removing the $ and # and 0.00. Is there anothe way of doing it besides what I did?

    [code]txtEnding.Text = Format(curInitInv * sngInterest, ""$###,##0.00"")[/code]

    [code]txtEnding.Text = Format(curInitInv * sngInterest, "")[/code]

    The last error was because I did not define or DIM intPress within the modedule it was in.

    Well if someone can still maybe give me any pointers or suggestions I'd like that! I'm totally new to programming.
  • ilasabbailasabba Member Posts: 13
    As you said you learn VB in your own, I recommend you the following tutorial

Sign In or Register to comment.