Okay this may be a bit trivial, it is a concept Im having difficulty understanding. When creating VB code I like to break up job steps/functions into seperate modules for example;
01Globals
02Cleardatatabl es
03 CreateDateStrin g
04 etc..etc
The module 01Globals list all of the variables used by every module and the code there calls each module in sequence;
This is my question: Do I have to include the following in each additional module;
Pseudo code
Once the workspace is created buy the initial module is it available to all of the other modules? What I've read to date isnt very clear and the few chance I've had to experiment have only added to my confusion.
01Globals
02Cleardatatabl es
03 CreateDateStrin g
04 etc..etc
The module 01Globals list all of the variables used by every module and the code there calls each module in sequence;
Code:
Option Compare Database
'Global Variables
Global gstrFileName As String
Global gstrFNDate As String
Global gstrDate As String
Global gstrFilePath As String
'Global gstrDate As String
Public Sub Start()
Dim dbs As Database
Set dbs = CurrentDb
ClearDataTables '02ClearDataTables
DateString '03CreateDateString
gstrFilePath "T:\Automation\01PkWood\KaladaData\AutomatedAdjustments_" & gstrDate & ".xls"
gstrFileName = "AdjClaimIn_" & gstrDate
Debug.Print "file pathe = " & gstrFilePath
Debug.Print "file Name = " & gstrFileName
ImportdataPull '04ImpotDataPull
CreatePtrackinput '05CreatePtrackInput
ExportTables '06ExportTables
End Sub
Pseudo code
Code:
Public Sub "Sub Name"()
Dim dbs As Database
Set dbs = CurrentDb
Comment