Solved

line continue vba code

Posted on 2009-07-06
6
588 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
Comment Utility
here is the screenshot
problem.gif
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
Comment Utility
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 74

Expert Comment

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

Author Comment

by:drtopserv
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now