?
Solved

line continue vba code

Posted on 2009-07-06
6
Medium Priority
?
648 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 1000 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

777 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