Error solved but it doesn't work - Sorry!!! I missed out 'Case'. How? don't ask me!
My brain is following the wrong path. Please advise the right path.
I have two controls and a 'doit' button. I click either control and wish to know which before sending text from another control to it, so that the correct format goes to the correct control. Having clicked (selected the destination control) I click the 'doit' button. I cannot simply use sender because the last sender is 'doit'.
I chose to store the original sender then when pressing 'doit' use 'select' to differentiate. An error in the doit sub says that the variable (the stored sender) is not used in sub.
[Edit] I have tried quotes around the 'Select' items but it is not accepted.
The code principle (to shorten) follows
sub controlA_click
gWhereTo=sender.name
do some things and formats
end sub
sub controlB_click
gWhereTo=sender.name
do different things and different formats
end sub
sub doit_click
Select gWhereTo
controlA
Control(gWhereTo).text=text from another control but formatted by controlA
controlB
Control(gWhereTo).text=text from another control but formatted by controlB
end select
end sub
My brain is following the wrong path. Please advise the right path.
I have two controls and a 'doit' button. I click either control and wish to know which before sending text from another control to it, so that the correct format goes to the correct control. Having clicked (selected the destination control) I click the 'doit' button. I cannot simply use sender because the last sender is 'doit'.
I chose to store the original sender then when pressing 'doit' use 'select' to differentiate. An error in the doit sub says that the variable (the stored sender) is not used in sub.
[Edit] I have tried quotes around the 'Select' items but it is not accepted.
The code principle (to shorten) follows
sub controlA_click
gWhereTo=sender.name
do some things and formats
end sub
sub controlB_click
gWhereTo=sender.name
do different things and different formats
end sub
sub doit_click
Select gWhereTo
controlA
Control(gWhereTo).text=text from another control but formatted by controlA
controlB
Control(gWhereTo).text=text from another control but formatted by controlB
end select
end sub
Last edited: