G
Guest
Hi. I have a form with 120 textbox controls, each of which has a label
hiding a command button which when clicked, goes through a series of
functions to get text data based on user choices, MyString. I then wish to
return to the original form (still open) original text box, and set the focus
back to it. How can I do this programically?
For eg: User clicks MyControl on frmMyDataEntry. MyControl is set
equal to varControlName. Functions run and text returned is strMyString
along with varControlName. I try to put it back into txbMyControl using:
Me.varControlName = strMyString
and I've tried
[Forms]![fmrMyDataEntry]![varControlName] = strMyString
where varControlName is a string type variable.
Neither of these work. I've also tried:
[Forms]![frmMyDataEntry]![(varControlName)] = strMyString - NOPE.
When I do a programming aside and just set focus manually, it accepts the
strMyString with no problem. What can I do here? What am I doing wrong? I
do not want to write separate procedures for each of the 120 controls.
Thanks in advance. It's probably an easy solution I've just not run into
before.
hiding a command button which when clicked, goes through a series of
functions to get text data based on user choices, MyString. I then wish to
return to the original form (still open) original text box, and set the focus
back to it. How can I do this programically?
For eg: User clicks MyControl on frmMyDataEntry. MyControl is set
equal to varControlName. Functions run and text returned is strMyString
along with varControlName. I try to put it back into txbMyControl using:
Me.varControlName = strMyString
and I've tried
[Forms]![fmrMyDataEntry]![varControlName] = strMyString
where varControlName is a string type variable.
Neither of these work. I've also tried:
[Forms]![frmMyDataEntry]![(varControlName)] = strMyString - NOPE.
When I do a programming aside and just set focus manually, it accepts the
strMyString with no problem. What can I do here? What am I doing wrong? I
do not want to write separate procedures for each of the 120 controls.
Thanks in advance. It's probably an easy solution I've just not run into
before.