Solved

line continue vba code

Posted on 2009-07-06
6
638 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

732 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