Help with truncating

  • Thread starter Thread starter ken
  • Start date Start date
K

ken

Hi,
I have another dumb newbe question. I tried looking in the help but,
maybe I'm using the wrong search criteria. Oh well. My question is
this. I would like to add the value of txtTimer1.Text to the end of
my label text. What happens now is the text will scroll off the form.
For example the txtTimer1.Text returns 1. 2. 3. 4. 5... etc. What I
would like is after a value is returned it displays that value only
and not a sequence of values. I would like to truncate to 1's, 10's,
and 100's. Can someone point me in the right direction. Thanks.
Regards,
Ken

frmKDMmain.lblFueltankquantity.Text = _
frmKDMmain.lblFueltankquantity.Text & " " & _
txtTimer1.Text
 
I'm not sure if I'm following you, but if I am this is what I would do. If
you know how long your initial label (say 15 characters long) you can
Left$(label.text, 15) & space(2) & txtTime1.text. This would keep writing
over the old txtTime1.text information.
Otherwise, if you don't know how long. Move the length in a variable at
start.
Dim iLen as integer
iLen = Len(label.text)

Then move your timer text
label.text = Left$(label.caption, iLen) & space(2) & txtTime1.text
 
Hi Issy,
This is what's being displayed on the form: Fuel tank quantity 0
gallons 1 gallons 2 gallons 3 gallons 4 gallons etc. across the form
When I want Fuel tank quantity # gallons were # is updated with the
new value and "gallons" is fix on the form
Ken
 
ken said:
Hi Issy,
This is what's being displayed on the form: Fuel tank quantity 0
gallons 1 gallons 2 gallons 3 gallons 4 gallons etc. across the form
When I want Fuel tank quantity # gallons were # is updated with the
new value and "gallons" is fix on the form

frmKDMmain.lblFueltankquantity.Text = _
"Fuel tank quantity " &_
txtTimer1.Text &_
" gallons"

Andrew
 
Back
Top