Solved

line continue vba code

Posted on 2009-07-06
6
642 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

729 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