formatting combobox

  • Thread starter Thread starter JT
  • Start date Start date
J

JT

In a form users, enter an amount in a text box. They can
enter 2.00, 2.0 or 2 for $2.00. This data is then moved
to a combobox.

However the user enters the data is how it appears in the
combobox.

Is there a way to either (1) format the amount as 2.00
automatically, no matter how they enter it, or (2) force
the user to enter the data correctly before they can leave
the text box (private sub?)?

Thanks for the help....Mike
 
sStr = Textbox1.Text
sStr = replace(sStr,"$","")
if isnumeric(sStr) then
sStr = format(cdbl(sStr),"0.00")
Combobox1.AddItem sStr
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top