Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

line of code to big to fit on line!! HELP?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rooster - 28 Feb 2005 20:31 GMT
Hey
Ive got a line of code and its too big to fit on just one line.  Is there
anyway i can put it on two lines but logically link it? or do i need to
rewrite the line of code?

Cheers
Mark - 28 Feb 2005 20:55 GMT
In VBA, you can use the underscore character (with a space in front of it)
as a line-break:

   If (PrevControlName = "") Or (PrevFormName = "") _
       Or (FormName <> PrevFormName) _
       Or (ControlName <> PrevControlName) Then

These three lines will be interpreted as one long line of code when it's
run.

> Hey
> Ive got a line of code and its too big to fit on just one line.  Is there
> anyway i can put it on two lines but logically link it? or do i need to
> rewrite the line of code?
>
> Cheers
Johnny Bright - 28 Feb 2005 20:57 GMT
Do you mean something other than the line continuation character which is
just a space and underscore?  
As in:
If me.txtTextBox <>0 and me.txtAnotherTextBox <1 and me.txtAThirdTextBox _
= something else then
msgbox "Hi"
end if
Notice the space and underscore at the end of the long line.

HTH

John

> Hey
> Ive got a line of code and its too big to fit on just one line.  Is there
> anyway i can put it on two lines but logically link it? or do i need to
> rewrite the line of code?
>
> Cheers
David C. Holley - 01 Mar 2005 00:35 GMT
Use the underscore  _    character between any naturally occurring space

> Hey
> Ive got a line of code and its too big to fit on just one line.  Is there
> anyway i can put it on two lines but logically link it? or do i need to
> rewrite the line of code?
>
> Cheers
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.