Smit
09-24-2012, 06:52 AM
Hello I am new to this forum and VBA programming world. Can someone please help me with this.
How do I write this following statement in multiple lines. Which works same as /n in C programming.
Private Sub cmdSave_Click()
CurrentDb.Execute "INSERT INTO Alewife (Total, Finclip, Lamprey,B1,B2,B3,B4,B5,B6,B7,B8, B9,B10,B11,B12,B13,B14,B15,B16,B17,B18,B19,B20,B21,B22,B23,B24,B25,B26,B27, B28,B29,B30,Label,Dcomments,Data,Fcomments,Field) VALUES ('" & Me.txtCount1.Value & "','" & Me.chkTag1.Value & "','" & Me.chklamp1.Value & "','" & Me.txtB1.Value & "','" & Me.txtB2.Value & "','" & Me.txtB3.Value & "','" & Me.txtB4.Value & "','" & Me.txtB5.Value & "','" & Me.txtB6.Value & "','" & Me.txtB7.Value & "','" & Me.txtB8.Value & "','" & Me.txtB9.Value & "','" & Me.txtB10.Value & "','" & Me.txtB11.Value & "','" & Me.txtB12.Value & "','" & Me.txtB13.Value & "','" & Me.txtB14.Value & "','" & Me.txtB15.Value & "','" & Me.txtB16.Value & "','" & Me.txtB17.Value & "','" & Me.txtB18.Value & "','" & Me.txtB19.Value & "','" & Me.txtB20.Value & "','" & Me.txtB21.Value & "','" & Me.txtB22.Value & "','" & Me.txtB23.Value & "','" & Me.txtB24.Value & "','" & Me.txtB25.Value & "','" & Me.txtB26.Value & "','" & Me.txt27.Value & "');"
The statement is not done yet, but you get the idea. I am trying to put this in multiple lines so it looks neat in VB. I tried using _ & at the end of line but doesn't work. Can someone fix it for me ?
Thank you
How do I write this following statement in multiple lines. Which works same as /n in C programming.
Private Sub cmdSave_Click()
CurrentDb.Execute "INSERT INTO Alewife (Total, Finclip, Lamprey,B1,B2,B3,B4,B5,B6,B7,B8, B9,B10,B11,B12,B13,B14,B15,B16,B17,B18,B19,B20,B21,B22,B23,B24,B25,B26,B27, B28,B29,B30,Label,Dcomments,Data,Fcomments,Field) VALUES ('" & Me.txtCount1.Value & "','" & Me.chkTag1.Value & "','" & Me.chklamp1.Value & "','" & Me.txtB1.Value & "','" & Me.txtB2.Value & "','" & Me.txtB3.Value & "','" & Me.txtB4.Value & "','" & Me.txtB5.Value & "','" & Me.txtB6.Value & "','" & Me.txtB7.Value & "','" & Me.txtB8.Value & "','" & Me.txtB9.Value & "','" & Me.txtB10.Value & "','" & Me.txtB11.Value & "','" & Me.txtB12.Value & "','" & Me.txtB13.Value & "','" & Me.txtB14.Value & "','" & Me.txtB15.Value & "','" & Me.txtB16.Value & "','" & Me.txtB17.Value & "','" & Me.txtB18.Value & "','" & Me.txtB19.Value & "','" & Me.txtB20.Value & "','" & Me.txtB21.Value & "','" & Me.txtB22.Value & "','" & Me.txtB23.Value & "','" & Me.txtB24.Value & "','" & Me.txtB25.Value & "','" & Me.txtB26.Value & "','" & Me.txt27.Value & "');"
The statement is not done yet, but you get the idea. I am trying to put this in multiple lines so it looks neat in VB. I tried using _ & at the end of line but doesn't work. Can someone fix it for me ?
Thank you