Set control source to table record

steve1111

Registered User.
Local time
Today, 18:55
Joined
Jul 9, 2013
Messages
170
Hello,

I am trying to set the control source of a textbox to a line of code in a table. I have a cbx that has "dates" like yesterday, tomorrow, last quarter etc. on the after update i want two hidden text boxes to update with the correct formula that i stored in the table. I have the control source of the text box something like
=dlookup("[FromCode]", "tblDClusters" "[ID] = " & combobox)

it is finding the code ok by I didn't expect it to put in the string of the code and not work through the formula. so "Yesterday" prompts the lookup and the textbox reads =Date()-1 and not 3/24/2016.

thanks for any tips.
 
Untested shot in the dark, but try wrapping the DLookup() in the Eval() function.
 
Thanks for the idea but gave it gave the same negative results
 
remove the "=" from your formCode field, dont use controlsource but instead put the value direct to the control using eval:

me.control = eval(dlookup("[FromCode]", "tblDClusters" "[ID] = " & combobox))
 
Last edited:

Users who are viewing this thread

Back
Top Bottom