error ???????

A

Alexander

Column(1), which is 2d in a table, is text(50).

Somehow if it's only a number (45 or 145) it's Ok. But, If
it's a combination of a number with letter (45B) it
generates a mistake #0.

Dim strString As String

strString = CCur(Me.cboComboBox.Column(1))

Any advice would be appreciated.

Thanks
 
G

Graham Mandeno

Hi Alexander

The CCur function tries to convert a value of any type to a currency value.
If the value is not numeric, it will fail with an error. The string "45B"
is not entirely numeric, so it will fail.

Are you really wanting to convert to Currency? If so, then why are you
converting the result back to a string variable?

If you want to extract the leading number form a string like "45B", then use
the Val function, which will return 45.
 

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

Similar Threads


Top