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 / February 2005

Tip: Looking for answers? Try searching our database.

Procedure-Level Variables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig - 27 Feb 2005 01:36 GMT
I am successful in the 1st Procedure-Level variable but then I try the next
procedure level after saving the 1st and also in another module, but am still
unsuccessful.

The Msg box just appears blank.
John Vinson - 27 Feb 2005 01:41 GMT
>I am successful in the 1st Procedure-Level variable but then I try the next
>procedure level after saving the 1st and also in another module, but am still
>unsuccessful.
>
>The Msg box just appears blank.

Please post the relevant portion of your code. I have NO trace of an
idea what you're trying to do.

                 John W. Vinson[MVP]    
Chris2 - 27 Feb 2005 05:04 GMT
> I am successful in the 1st Procedure-Level variable but then I try the next
> procedure level after saving the 1st and also in another module, but am still
> unsuccessful.
>
> The Msg box just appears blank.

Craig,

Could you provide a more extensive description, please?

Sincerely,

Chris O.
Craig - 28 Feb 2005 03:07 GMT
I would like to provide the code I used:

Option Compare Database

Sub Suburb()
Dim Suburb As String
Suburb = Charlestown
MsgBox Suburb
End Sub

I also tried using it as a private sub and public sub.

Yours Sincerely,

> > I am successful in the 1st Procedure-Level variable but then I try
> the next
[quoted text clipped - 11 lines]
>
> Chris O.
Chris2 - 28 Feb 2005 03:24 GMT
> I would like to provide the code I used:
>
[quoted text clipped - 9 lines]
>
> Yours Sincerely,

Craig,

When I execute the code, the debugger stops, highlighting
"Charlestown".  The error was: "Compile Error: Variable Not Defined."

The variable Charlestown must be declared, usually via Dim, before
being used.

If Charlestown is a string, it must be enclosed in "".

Sub Suburb()
 Dim Suburb As String
 Suburb = "Charlestown"
 MsgBox Suburb
End Sub

The above code will execute, and a MsgBox appears with the word
"Charlestown" in it.

Sincerely,

Chris O.
 
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.