Question

I've got a userform within an Excel vba project. At design-time it is empty.

In the form initialize event I've got the following code:

Private Sub UserForm_Initialize()

txtSQL.value = _
    "SELECT MyName = ""ColY"" " & vbCrLf & _
    "FROM SomeTable " & vbCrLf & _
    "GROUP BY Customer " & vbCrLf & _
    "ORDER BY Customer DESC"

End Sub

I was hoping for 4 separate lines of text in the textbox but instead have the following:

enter image description here

Am I using the wrong control? Or am I using the right control in the wrong way?

Was it helpful?

Solution

Whoops: maybe I should go to bed...

At design-time set multi-line property to True!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top