Howdy, Stranger!

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

Categories

Please say this is possible

Runt1128Runt1128 Member Posts: 18
I am sending results (numbers mostly) to a text box. I am mostly using something like this:

NL = Chr$(13) + Chr$(10)
ReportText = ReportText + NL + "Model Number: " + comboModel + NL

Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?


Comments

  • DaveRDaveR Member Posts: 98
    : I am sending results (numbers mostly) to a text box. I am mostly using something like this:
    :
    : NL = Chr$(13) + Chr$(10)
    : ReportText = ReportText + NL + "Model Number: " + comboModel + NL
    :
    : Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?
    :
    :
    :
    i'm not exacty sure what you are asking but you can replace NL with VbCrLf same as using Chr$(13) + Chr$(10) Chr$(13) inseerts a carriage return and thats what the CR stands for Chr$(10) inserts a line feed and thats what the Lf stands for.

    I i understand your question correctly you might want to try this

    Format(varible,"0.00")

  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : I am sending results (numbers mostly) to a text box. I am mostly using something like this:
    :
    : NL = Chr$(13) + Chr$(10)
    : ReportText = ReportText + NL + "Model Number: " + comboModel + NL
    :
    : Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?
    :

    For one thing, you can drop the whole NL routine if you want and use vbNewLine instead. This is a constant that is either 13,10 or 13 depending on the system.

    MsgBox Format$(123.45, "0.00")

    Don't know if it will mess you up, but Format$() does it's own rounding of the number.
  • DaveRDaveR Member Posts: 98
    : : I am sending results (numbers mostly) to a text box. I am mostly using something like this:
    : :
    : : NL = Chr$(13) + Chr$(10)
    : : ReportText = ReportText + NL + "Model Number: " + comboModel + NL
    : :
    : : Thats a small example of one of the things im ending to the textbox. Is it possible to use something like....Print Using "####.##" for the number results (123.45) that are gonna be sent to the same location? Does this make sense what im saying?
    : :
    :
    : For one thing, you can drop the whole NL routine if you want and use vbNewLine instead. This is a constant that is either 13,10 or 13 depending on the system.
    :
    : MsgBox Format$(123.45, "0.00")
    :
    : Don't know if it will mess you up, but Format$() does it's own rounding of the number.
    :
    i don't think VbNewLine works with the NT OS. i am not certain on this but i remeber reading somewhere saying that it isn't supported on all OS.
  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : i don't think VbNewLine works with the NT OS. i am not certain on this but i remeber reading somewhere saying that it isn't supported on all OS.
    :

    That would be really weird since it's an internal constant, but I wouldn't put it past Microsoft to pull something like that.
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _______ \ http://forcoder.org \ free ebooks and video tutorials about // C#, JavaScript, PL/SQL, Scratch, Ruby, Java, MATLAB, Visual Basic, C, PHP, C++, Perl, Assembly, Python, R, Swift, Visual Basic .NET, Go, Objective-C, Delphi SAS, Ada, Transact-SQL, D, ML, Lua, Kotlin, VBScript, F#, LabVIEW, Awk, ABAP, Alice, COBOL, Rust, Crystal, Logo, Hack, Clojure, FoxPro, Scala, Julia, Scheme, Apex, Lisp, Prolog, Dart, Fortran, Erlang, Bash // __

Sign In or Register to comment.