continue on next line in code

cliff7376

Registered User.
Local time
Today, 08:40
Joined
Oct 10, 2001
Messages
107
Hi I have a problem. I have a sql statement in code that is longer than the line. everytime i try to use the underscore to continue on the next line i get an error. I think it has to do with the whole statement bieng in one long quote"". is there another way to do this. please help
 
1. If you have &_ try putting a space between them and that may solve your problem.

2. Alternatively you can build you SQL in bits like so:

Dim strSQL as string

strSQL = "Select *"
strSQL = strSQL & " FROM "
strSQL = strSQL & "myTable"

at the end strSQL will equal "Select * FROM myTable"

HTH

Ian
 

Users who are viewing this thread

Back
Top Bottom