setting multiline textbox controlsource to string through code

  • Thread starter Thread starter Jesper F
  • Start date Start date
J

Jesper F

I want to set the controlsource of a textbox to something like this through
code:

83
Foo
Bar

On 3 lines.
I trying to set it with
me.textboxname.controlsource = number & vbcrlf & sFoostring & vbcrlf &
sBarstring
This doesn't work however. To set it manually in the property sheet I would
use
="83 (shift+return) Foo (shift+return) Bar"
I can't seem to get the beginning and end quotes in there when doing it
through code.
Since it's text I can't ommit the quotes.
How's this done? Thanks.

Jesper
 
Got it.
I needed to do it like this:

me.control.controlsource = "=" & chr(34) vbcrlf & stuff &
vbcrlf & chr(34)
 
Back
Top