M mergle Registered User. Local time Today, 03:01 Joined Jan 31, 2003 Messages 54 Nov 27, 2009 #1 I am wanting to store an expression as a string value in a bound textbox (example: "=1/(4*8)"), and then use it as a control source in another textbox. Would this have to be done as a VBA function?
I am wanting to store an expression as a string value in a bound textbox (example: "=1/(4*8)"), and then use it as a control source in another textbox. Would this have to be done as a VBA function?
boblarson Smeghead Local time Today, 00:01 Joined Jan 12, 2001 Messages 32,040 Nov 27, 2009 #2 You could set the other text box's control source to: =Eval([YourTextBoxNameHere]) leaving the square brackets around it. Then you can enter this: 1/(4*8) and it will evaluate it.
You could set the other text box's control source to: =Eval([YourTextBoxNameHere]) leaving the square brackets around it. Then you can enter this: 1/(4*8) and it will evaluate it.
M mergle Registered User. Local time Today, 03:01 Joined Jan 31, 2003 Messages 54 Nov 28, 2009 #3 That's exactly what I needed... Thank you.
E Evagrius Registered User. Local time Today, 01:01 Joined Jul 10, 2010 Messages 170 Apr 11, 2011 #4 Hi Bob - what if the textbox with the source data is located in a sub form in the main form. I keep getting a #name error?
Hi Bob - what if the textbox with the source data is located in a sub form in the main form. I keep getting a #name error?
boblarson Smeghead Local time Today, 00:01 Joined Jan 12, 2001 Messages 32,040 Apr 11, 2011 #5 Remember to use the right syntax for subforms. For your purpose I would suggest using this method to get it: http://www.btabdevelopment.com/ts/refer2sfrms
Remember to use the right syntax for subforms. For your purpose I would suggest using this method to get it: http://www.btabdevelopment.com/ts/refer2sfrms