Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.