Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieve DefaultValue in VBA

Status
Not open for further replies.

SirTECH

Technical User
Jul 24, 2005
42
CA
I have comboBoxes on a form that has a defaultvalue set as =GetINFO(string,date,number)
Once the default value is changed on the form by the user, it is written to a table.
I wanted a quick routine to check what the default value was, however when I use:

Dim strVAL as string
strVAL = Form.ComboBox.DefaultValue

I get, =GetINFO(string,date,number)
instead of the value the function call provides.

Is there a way to get and run the function attached to the control's defaultvalue?
 
Have you tried to play with the Eval function ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I had tried eval but got no result. But since you suggested it I decided to try it again, and this time it worked.
Then I realized why it failed the first time. The default value on the selected date should have been null and of course produced no result. Using a different date, eval did produced a result.
What a dummy I am. I should have tested it on more than one date criteria before seeking help.
Nonetheless, thank you for your help and correct solution!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top