using some code
Code:
Dim strSQL As String
'Purpose: Convert a SQL statement into a string to paste into VBA code.
Const strcLineEnd = " "" & vbCrLf & _" & vbCrLf & """"
If IsNull(Me.txtSql) Then
Beep
Else
strSQL = Me.txtSql
strSQL = Replace(strSQL, """", """""") 'Double up any quotes.
strSQL = Replace(strSQL, vbCrLf, strcLineEnd)
strSQL = "strSql = """ & strSQL & """"
Me.txtVBA = strSQL
Me.txtVBA.SetFocus
End If
This moves sql into a string for vba however
every so many characters (say 200) I would like to add another end string with " & _ and then vbCrLf and add another & " to that next line
That way everything fits nicely on my page.
any suggestions?
I was thinking of using left() and then inserting it all somehow at that position - not sure how