Attribute VB_Name = "modPublicVariables" Option Compare Database ' declare the default string comparison method based on the sort order of the database Option Explicit ' Makes the programmer declare all variables Option Base 0 ' Explicitly sets the lower bound of arrays to zero ' ' Public variables are used throughout the application to maintain selected values ' ' Database Tracking Variables used to keep identification numbers & names ' ' Arguments '************************************* Public lWhereAmI As Long ' index to current location in the interface '************************************* Public bIsGISGridOK As Boolean ' Yes/No Flag to control grid related activities Public bIsEcoregionOK As Boolean ' Yes/No Flag to control ecoregion related activities Public bIsSiteInGrid As Boolean ' Yes/No Flag to test if site is within the grid Public bIsLakeBasin As Boolean ' Yes/No Flag to test if analysis has lake basin Public lMyAnalysis As Long ' index to current HighwayAnalysis_ID number tblHighwayAnalysis Public lMyAnalysisTypeID As Long ' index to current type of analysis see tdsAnalysisType Public lMyAnalysisStatusID As Long ' index to current analysis status see tdsAnalysisStatus Public lMyAnalystRole As Long ' index to current AnalystRole_ID number tadAnalystAnalysis Public lMyAnalystID As Long ' index to current analyst_ID number tblAnalyst Public lMyEcoregionID As Long ' index to current Ecoregion ID number tblHighwayAnalysis Public lMyEcoregionGroup As Long ' index to ecoregion group in table tblproject Public lMyGISGridID As Long ' index to current GISGrid ID number Public lMyGISGridCell As Long ' Specified Grid Cell tblHighwayAnalysis Public lMyHighway As Long ' index to current HighwaySite_ID number tblHighwaySite Public dMyLatVal As Double ' index to current latitude Public dMyLongVal As Double ' index to current longitude Public lMyProject As Long ' index to current Project_ID number tblProject Public lMyUpstreamBasin As Long ' index to current UpstreamBasin_ID tblUpstreamBasin Public lMyLakeBasin As Long ' index to current LakeDrainageBasin_ID tblLakeBasin Public lMyTempSites() As Long ' long array to store a temporary siteID list Public strUniversalStr As String ' Universal string ' Precip Public lMyPrecipStat As Long ' index to selected precipitation stats for highway analysis Public lMyPrecipGroup As Long ' Precipitation Group ' Streamflow Public lMyStreamflowDataSet As Long ' streamflow dataset Public lMyStreamflowStat As Long ' index to selected streamflow stats for highway analysis Public lMyStreamflowGroup As Long ' streamflow Group 'Public lMyStreamStat As Long ' index to to current streamflow statistics ID in tblStreamFlowSelection 'Public strHwyShortNM As String ' highway short name 'Public strAnalysisNM As String ' short Analysis name 'Public intCNErr As Integer ' CN error condition 0=ok 1 = error ' ' Unit Conversion constants ' Public Const dD2R As Double = 1.74532925199433E-02 ' Degrees to Radians Public Const dR2D As Double = 57.2957795130823 ' Radians to degrees Public Const Ac2SqFt As Double = 43560# ' Acres to square feet Public Const SqMi2SqFt As Double = 27878400# ' Square miles to square feet Public Const Liter2CuFt As Double = 0.035315 ' liters (or L/s) to cubic feet per second (or cfs) Public Const dCSFM2LiterSKm As Double = 10.93309 ' cubic feet per second per square mile (cfsm) to L/S/km2 ' ' Random Array Constants ' ' lWhereAmI table ' 0: Welcome screen ' 1: Analyst Public Function bDoLakeAnalysis(lngInAnalysis As Long) As Boolean ' ' Purpose: ' To determine if the analysis includes a lake analysis ' History: ' Version 1.0 January 03 2009 by Gregory E. Granato ' ' Arguments Dim strSQL As String Dim rstLakeAnalysis As ADODB.Recordset ' recordset Dim bHasdata As Boolean Dim intOutErr As Integer On Error GoTo bDoLakeAnalysis_Err: intOutErr = 0 bDoLakeAnalysis = False 'Reference an ADO Recordset Set rstLakeAnalysis = New ADODB.Recordset strSQL = "SELECT tblHighwayAnalysis.bLakeBasinAnalysis " & _ "FROM tblHighwayAnalysis " & _ "WHERE (((tblHighwayAnalysis.HighwayAnalysis_ID)=" & lngInAnalysis & "));" rstLakeAnalysis.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly ' Check values bHasdata = False If rstLakeAnalysis.BOF And rstLakeAnalysis.EOF Then ' There is no data for this analysis bHasdata = False ElseIf IsNull(rstLakeAnalysis.Fields(0).Value) = False Then If IsEmpty(rstLakeAnalysis.Fields(0).Value) = False Then bHasdata = True ' There is no data for this analysis End If If bHasdata = True Then bDoLakeAnalysis = CBool(Nz(rstLakeAnalysis.Fields("bLakeBasinAnalysis").Value, 0)) CleanUp: If rstLakeAnalysis.State = adStateOpen Then rstLakeAnalysis.Close 'IF Recordset is open, close it Set rstLakeAnalysis = Nothing 'Free memory Exit Function bDoLakeAnalysis_Err: bDoLakeAnalysis = False intOutErr = intOutErr + 1 If intOutErr < 2 Then Resume CleanUp: Exit Function End Function