Link to home
Create AccountLog in
Avatar of UTSWPeds
UTSWPedsFlag for United States of America

asked on

When using .defaultvalue in VBA for access, the text values return with double-quotes surrounding the value.

After an "OnClick" function in an Access 2003 DB, I want to have a text box value be reset to it's default value.  When I use the code below, I get a value returned with double quotes surrounding that value, which is also how it apears on the property sheet of the form.  I want to pass the default value back to the text box without the quotation marks.

Me.Controls(strFundingTypeName).Value = Me.Controls(strFundingAmtName).DefaultValue

where strFundingAmtName is a text value.

I understand this isn't an ideal situation, but it's what I'm stuck with at the moment, so while appreciated, I'm more interested in a working solution than I am design ideas or critiques of the process.  Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
"I want to have a text box value be reset to it's default value"

...at the moment you are setting to the default value of a different control.  Is that what you intend?
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of UTSWPeds

ASKER

Both solutions work well, but I allocated the bulk of the points to @Capricorn1 for having the first response.  

@Peter57r is also correct, I had a typo in the question, but @Capricorn1 and @cactus_data (fortunately for me) were able to fight through my erroneous post to the core issue for which I needed a solution.  Many thanks.