Solved

line continue vba code

Posted on 2009-07-06
6
631 Views
Last Modified: 2013-12-25
as u can see in the attached gif file, i`d like to use line continues (space _) in that code but it tells complie error.
second if there is another way to do what i indent to do in attached code i`ll be glad .
i have userform1 which i fill in textbox and checkboxes.
i need to insert each command&textboxes in that form to mdb file .
how to?
0
Comment
Question by:drtopserv
  • 2
  • 2
6 Comments
 

Author Comment

by:drtopserv
ID: 24785387
here is the screenshot
problem.gif
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 24785462
Line continuation in VBA/VB is accomplished with the underscore ( _ ) character. However, because you are trying to continue strings, you will need to combine the underscore with the ampersand ( & ).
ComStr = "Insert into IrisBlond1" & _
           "(CustomerName, CustomerID, AdviceDate, Form1, Form1ProductType1, Form1FundName1, Form2, ..."

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24785465
Ampersand is the string concatenation operator in VBA/VB.
0
 

Author Comment

by:drtopserv
ID: 24785556
grt
second if there is another way to do what i indent to do in attached code i`ll be glad .
i have userform1 which i fill in textbox and checkboxes.
i need to insert each command&textboxes in that form to mdb file .
how to?
0
 
LVL 10

Expert Comment

by:therealmongoose
ID: 24785640
Think this should be something like:
ComStr = "Insert into IrisBlond1 (CustomerName, CustomerID, AdviceDate) values (" & worksheets("datafix").cells(1,1) & ", " & worksheets("datafix").cells(1,2) & ", " & worksheets("datafix").cells(1,3) & ")"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question