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.

vbCrlf works in text box 1 but not text box 2

A User selects items from a list. Each selection is displayed in text box 1 in multiple lines. The operating cost for the item is displayed in text box 2. Both text boxes are long enough to accommodate multiple entries. Eventually a running sub total will be displayed in text box 3 located below text box 2. VbCrlf works fine in text box 1 but won't work in text box 2. Multiple selections display one below the other in text box 1 but the cost of the last selection replaces the previous selection in text box 2. No matter how many selections are displayed in text box 1 only 1 value is displayed in text box 2. I've searched here and many sources but haven't found an answer to this. Any advice greatly appreciated.

vbCrlf

Thanks. I checked it out and discovered I made a mistake. Haven't worked on this in a long time. Selections are transferred from one list box to another list box, not text box 1. Only the costs are displayed in a text box. Still can't figure out why vbcrlf works in a list box but not the text box.

vbCrlf

The more I fix the more I run into a hornet's nest. If "remove item" is enabled for list box 1 and 2, items move from 1 to 2 when selected but the cost doesn't change in text box 1. When the first item is selected, the cost for that item is displayed and stays there. I'm about ready to chuck this nightmare. Have been working on it on and off for a very long time. Seemed like a simple enough concept but I simply don't know how to get it to work. All I want to do is select items from a list box, have the cost for each item display in a text box with a running total in another text box. Every time I search for VB help all I find is answers to much more sophisticated problems. Thanks for your help.

All I want to do is select items from a list box, have the cost for each item display in a text box with a running total in another text box.

This seems like a fairly easy to accomplish program specification.

If you handed this to me, my question would be: When I select something from the listbox, where is the associated price coming from? Am I reading it from a database? A text file? Do I just make something up?

Other than that I would have two number variables. Something like intPrice and intTotal. intPrice would hold the individual price which would be added to intTotal.

I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. Please use [Code]your code goes in here[/Code] tags when posting code.Before posting your question, did you look here?Got a question on Linux? Visit our Linux sister site.Modifications Required For VB6 Apps To Work On Vista