setting multiline textbox controlsource to string through code

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
 
J

Jesper F

Got it.
I needed to do it like this:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top