How to split Lines of VB Code too Long?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a problem with some lines of VB Code which are too long for one
line position to hold. Is there some way to wrap the code down to the next
line without disturbing the logic of the code?

For example:

lsSQL = "INSERT INTO 5_Deficiency_Item ([ITEM_ID],[Eval_Framework_Chart])
VALUES('" & Me![InvisibleID1] & "',2)"

when I split the code like I did above, it shows as an error.

Thanks!
 
lsSQL = "INSERT INTO 5_Deficiency_Item ([ITEM_ID], " & _
"[Eval_Framework_Chart]) " & _
" VALUES('" & Me![InvisibleID1] & "',2)"

Madhuri
 
Thank you Madhuri!!

Madhuri said:
lsSQL = "INSERT INTO 5_Deficiency_Item ([ITEM_ID], " & _
"[Eval_Framework_Chart]) " & _
" VALUES('" & Me![InvisibleID1] & "',2)"

Madhuri


jrtmax said:
I am having a problem with some lines of VB Code which are too long for one
line position to hold. Is there some way to wrap the code down to the next
line without disturbing the logic of the code?

For example:

lsSQL = "INSERT INTO 5_Deficiency_Item ([ITEM_ID],[Eval_Framework_Chart])
VALUES('" & Me![InvisibleID1] & "',2)"

when I split the code like I did above, it shows as an error.

Thanks!
 
Hello Madhuri,

Does this trick only work after commas or parentheses? I tried it after
after the word "Or" in a conditional statement, and also while trying to
split the text of a message box to the next line, and it didn't work.

Thanks!

alepag

Madhuri said:
lsSQL = "INSERT INTO 5_Deficiency_Item ([ITEM_ID], " & _
"[Eval_Framework_Chart]) " & _
" VALUES('" & Me![InvisibleID1] & "',2)"

Madhuri


jrtmax said:
I am having a problem with some lines of VB Code which are too long for one
line position to hold. Is there some way to wrap the code down to the next
line without disturbing the logic of the code?

For example:

lsSQL = "INSERT INTO 5_Deficiency_Item ([ITEM_ID],[Eval_Framework_Chart])
VALUES('" & Me![InvisibleID1] & "',2)"

when I split the code like I did above, it shows as an error.

Thanks!
 
Back
Top