How to split Lines of VB Code too Long?

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!
 
G

Guest

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

Madhuri
 
G

Guest

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!
 
G

Guest

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!
 

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