error ???????

  • Thread starter Thread starter Alexander
  • Start date Start date
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
 
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.
 
Back
Top