Anthony Viscomi wrote:
>I have the following:
>
>Const cQuote = ""
>Const cQuotePos = ""
>Me.Base_Price.DefaultValue = cQuote & Me.Base_Price.Value & cQuote
>Me.Position.Value = cQuotePos & Me.Position.Value & cQuote + 0.1
>
>The 1st portion works fine; but the 2nd doesn't seem to like me adding the
>.1 value to it. The control (Positon) is numeric.
Your constants are both declared as zero length strings
(ZLS) so they have no real effect in setting the
DefaultValue. Since the DefaultValue property is a string
valued property, VBA will automatically convert a numeric
value to a string and extra quotes are not needed.
Me.Base_Price.DefaultValue = Me.Base_Price.Value
However, in the position line, the simple act of using the &
operator forces VBA to convert the value to a string so the
+ also operates as a concatenation, not an addition. Just
change it to:
Me.Position.Value = Me.Position.Value + 0.1
--
Marsh
MVP [MS Access]
|