473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Help: Continue String Code to next line

ok, I'm trying to write a string code and currently the code works
however I've run out of room and I need to change some of the source
names it pulls from. Changing the source names create the string
longer and there is no room left. I need to know how I can split this
into two or more lines so I can update the code now and in the future.

strSQL = "SELECT tblEmployees.LastName, tblOutputs.OutputName,
tblBudgetedFigures.BudgetedTime, Sum(tblTimesheetEntries.Hours) AS
SumOfHours, [SumOfHours]/[BudgetedTime] AS PercentUsed,
tblSections.SectionID, tblSections.Section,
Sum(tblTimesheetEntries.TravelExpenses) AS SumOfTravelExpenses,
tblBudgetedFigures.TravelExpenses, IIf([Sumoftravelexpenses]=0,0,
[SumofTravelExpenses]/[tblbudgetedfigures].[TravelExpenses]) AS
PercentUsedTravel FROM tblSections INNER JOIN (tblOutputs INNER JOIN
((tblEmployees INNER JOIN tblBudgetedFigures ON
tblEmployees.EmployeeID = tblBudgetedFigures.EmployeeName) INNER JOIN
tblTimesheetEntries ON tblEmployees.EmployeeID =
tblTimesheetEntries.EmployeeID) ON (tblOutputs.OutputID =
tblTimesheetEntries.Output) AND (tblOutputs.OutputID =
tblBudgetedFigures.OutputName)) ON tblSections.SectionID =
tblEmployees.Section GROUP BY tblEmployees.LastName,
tblOutputs.OutputName, tblBudgetedFigures.BudgetedTime,
tblSections.SectionID, tblSections.Section,
tblBudgetedFigures.TravelExpenses "

I hope someone can help, I'm fairly new to the whole
VBA coding and am updating some access databases for my office that
has this code. The code above currently runs all in a single line
which runs out of room and doesn't allow me to add more because of the
character limit. For example, I need to change tblOutputs to
tblOutputs2008, thus making the line longer however it doesn't allow
me to. What I ultimately need to do is figure out a way to split the
code onto two separate lines and have the code continue to work and
read from the end of the first line and continue at the beginning of
the second. I hope this description helps. Thanks

Oct 4 '07 #1
2 23441
"fhwa" <Ro**********@fhwa.dot.govschrieb
ok, I'm trying to write a string code and currently the code works
however I've run out of room and I need to change some of the source
names it pulls from. Changing the source names create the string
longer and there is no room left. I need to know how I can split
this into two or more lines so I can update the code now and in the
future.

[...]

I hope someone can help, I'm fairly new to the whole
VBA
This is not a VBA group. If you are using VB.Net (at least then):
http://msdn2.microsoft.com/en-us/lib...w4(VS.80).aspx
Armin
Oct 4 '07 #2
JR


"fhwa" <Ro**********@fhwa.dot.govschreef in bericht
news:11*********************@w3g2000hsg.googlegrou ps.com...
ok, I'm trying to write a string code and currently the code works
however I've run out of room and I need to change some of the source
names it pulls from. Changing the source names create the string
longer and there is no room left. I need to know how I can split this
into two or more lines so I can update the code now and in the future.

strSQL = "SELECT tblEmployees.LastName, tblOutputs.OutputName,
tblBudgetedFigures.BudgetedTime, Sum(tblTimesheetEntries.Hours) AS
SumOfHours, [SumOfHours]/[BudgetedTime] AS PercentUsed,
tblSections.SectionID, tblSections.Section,
Sum(tblTimesheetEntries.TravelExpenses) AS SumOfTravelExpenses,
tblBudgetedFigures.TravelExpenses, IIf([Sumoftravelexpenses]=0,0,
[SumofTravelExpenses]/[tblbudgetedfigures].[TravelExpenses]) AS
PercentUsedTravel FROM tblSections INNER JOIN (tblOutputs INNER JOIN
((tblEmployees INNER JOIN tblBudgetedFigures ON
tblEmployees.EmployeeID = tblBudgetedFigures.EmployeeName) INNER JOIN
tblTimesheetEntries ON tblEmployees.EmployeeID =
tblTimesheetEntries.EmployeeID) ON (tblOutputs.OutputID =
tblTimesheetEntries.Output) AND (tblOutputs.OutputID =
tblBudgetedFigures.OutputName)) ON tblSections.SectionID =
tblEmployees.Section GROUP BY tblEmployees.LastName,
tblOutputs.OutputName, tblBudgetedFigures.BudgetedTime,
tblSections.SectionID, tblSections.Section,
tblBudgetedFigures.TravelExpenses "

I hope someone can help, I'm fairly new to the whole
VBA coding and am updating some access databases for my office that
has this code. The code above currently runs all in a single line
which runs out of room and doesn't allow me to add more because of the
character limit. For example, I need to change tblOutputs to
tblOutputs2008, thus making the line longer however it doesn't allow
me to. What I ultimately need to do is figure out a way to split the
code onto two separate lines and have the code continue to work and
read from the end of the first line and continue at the beginning of
the second. I hope this description helps. Thanks
Try this one

strSQL = "first part" & _
"Next part" & _
"And so on"
the _ must proceed with a space
the last line can't have a _

2solution
if this does not work
strSQL1= "First part"
strSQL2="Second part"
strSQL3="3"
strSQL4="4"
strSQL=strSQL1+strSQL2+strSQL3+strSQL4

Oct 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old...
31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
15
by: Buck Rogers | last post by:
Hi guys! Task 1: Write a program which presents a menu with 5 options. The 5th option quits the program. Each option should execute a system command using system(). Below is my humble...
9
by: daniel | last post by:
Hi everyone, I'm trying to get this program compiled under Solaris. Unfortunately I have little experience with C. Solaris doesn't use the function strsep() anymore: char *strsep(char...
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
18
by: vermarajeev | last post by:
Hello everybody, This is my second query in this post. Firstly thankx to Banfa, for helping me solve my first query. Here is the code which I have written. #include<iostream>...
7
by: Gasten | last post by:
Hello. The last weeks I've been coding a roguelike (you know, like nethack) in python using the nCurses library. Some week ago I ran into a problem: When I made the object for messagebar-output, I...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
6
by: Extremest | last post by:
Does anyone know how to decode a yenc encoded file? I have created a decoder that seems to work great for text. Now i am trying to create another one for images and I can't get it to work. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.