Please say this is possible - Programmers Heaven

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 Posts: 18Member
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 Posts: 98Member
    : 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 Posts: 3,948Member
    : 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 Posts: 98Member
    : : 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 Posts: 3,948Member
    : 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.
Sign In or Register to comment.