Ok I have a new stupid problem. It has to do with formatting string correctly.
ATTENTION. Obviously the forum doesn't support correct formatting so the output is screwed up. Let me describe what the problem is.
The price 2.30 moves one place to the right everytime the length of item is increased BUT it should not since I am taking the length of Item into account for spacing.
FIGURED THIS OUT: Text and spaces don't take up the same amount of space. That is why the text is not staying formatted correctly. Anyone know a font where a space takes up the same area as characters?
here is what I am doing in a textbox:
txtorder.Text = txtorder.Text & "Order for " & txtName.Text & ":" & _
vbCrLf & "Item" & Space$(25) & "Price" & Space$(10) _
& "Quantity" & Space$(10) & "Cost" & vbCrLf
spaces = 25 - Len(txtItem.Text)
txtorder.Text = txtorder.Text & txtItem.Text & Space$(spaces) & txtPrice.Text & vbCrLf
I get out put like this
Order for Jon Doe:
Item Price Quantity Cost
Apples 2.30
Order for Jon Doe:
Item Price Quantity Cost
Apples2 2.30
Order for Jon Doe:
Item Price Quantity Cost
Apples23 2.30
As you see the price(2.30) keeps moving to the right even though I am supposidly using less spaces. Apples are the txtItem.text.
I can't figure out why it keeps creating extra spaces in the output eventhough I am taking into account how long the txtItem is.
The last line of code is the problem.
Help.
Jim
ATTENTION. Obviously the forum doesn't support correct formatting so the output is screwed up. Let me describe what the problem is.
The price 2.30 moves one place to the right everytime the length of item is increased BUT it should not since I am taking the length of Item into account for spacing.
FIGURED THIS OUT: Text and spaces don't take up the same amount of space. That is why the text is not staying formatted correctly. Anyone know a font where a space takes up the same area as characters?
here is what I am doing in a textbox:
txtorder.Text = txtorder.Text & "Order for " & txtName.Text & ":" & _
vbCrLf & "Item" & Space$(25) & "Price" & Space$(10) _
& "Quantity" & Space$(10) & "Cost" & vbCrLf
spaces = 25 - Len(txtItem.Text)
txtorder.Text = txtorder.Text & txtItem.Text & Space$(spaces) & txtPrice.Text & vbCrLf
I get out put like this
Order for Jon Doe:
Item Price Quantity Cost
Apples 2.30
Order for Jon Doe:
Item Price Quantity Cost
Apples2 2.30
Order for Jon Doe:
Item Price Quantity Cost
Apples23 2.30
As you see the price(2.30) keeps moving to the right even though I am supposidly using less spaces. Apples are the txtItem.text.
I can't figure out why it keeps creating extra spaces in the output eventhough I am taking into account how long the txtItem is.
The last line of code is the problem.
Help.
Jim