N
Nick X
Happy New Year Everyone,
I have some complex SQL statements that I would like to assign to a couple
different Events. Any Ideas would be appreciated.
Thanks
Dim strSQLAll As String
Dim strSQLsearch As String
strSQLAll = "SELECT PtblBenchmark.BMNum, PtblBenchmark.Name,
PtblBenchmark.Northing, " & _
"PtblBenchmark.Easting, PtblBenchmark.st_name_1,
PtblBenchmark.st_name_2, " & _
"Switch([cboFieldList]=" & """1971 Elevation""" &
",[Elevation],[cboFieldList]=" & """Archived Elevation""" & "," & _
"[ArchivedElev],[cboFieldList]=" & """Local 88 Elevation""" &
",[ElevChk],[cboFieldList]=" & """GPS Elevation""" & "," & _
"[ElevGPS],[cboFieldList]=" & """NGS Elevation""" &
",[ElevGPS],[cboFieldList]=" & """""" & ",[Elevation]) AS Elev, * " & _
"FROM PtblBenchmark;"
strSQLsearch = "SELECT PtblBenchmark.BMNum, PtblBenchmark.Name,
PtblBenchmark.Northing, " & _
"PtblBenchmark.Easting, PtblBenchmark.st_name_1,
PtblBenchmark.st_name_2, " & _
"Switch([cboFieldList]=" & """1971 Elevation""" &
",[Elevation],[cboFieldList]=" & """Archived Elevation""" & "," & _
"[ArchivedElev],[cboFieldList]=" & """Local 88 Elevation""" &
",[ElevChk],[cboFieldList]=" & """GPS Elevation""" & "," & _
"[ElevGPS],[cboFieldList]=" & """NGS Elevation""" &
",[ElevGPS],[cboFieldList]=" & """""" & ",[Elevation]) AS Elev, * " & _
"FROM PtblBenchmark " & _
"WHERE (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y1] And [forms]![frmBenchmarkSearch]![Y2]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X1] And
[forms]![frmBenchmarkSearch]![X2])) OR (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y2] And [forms]![frmBenchmarkSearch]![Y1]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X1] And
[forms]![frmBenchmarkSearch]![X2])) OR (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y1] And [forms]![frmBenchmarkSearch]![Y2]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X2] And
[forms]![frmBenchmarkSearch]![X1])) OR (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y2] And [forms]![frmBenchmarkSearch]![Y1]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X2] And
[forms]![frmBenchmarkSearch]![X1]));"
I have some complex SQL statements that I would like to assign to a couple
different Events. Any Ideas would be appreciated.
Thanks
Dim strSQLAll As String
Dim strSQLsearch As String
strSQLAll = "SELECT PtblBenchmark.BMNum, PtblBenchmark.Name,
PtblBenchmark.Northing, " & _
"PtblBenchmark.Easting, PtblBenchmark.st_name_1,
PtblBenchmark.st_name_2, " & _
"Switch([cboFieldList]=" & """1971 Elevation""" &
",[Elevation],[cboFieldList]=" & """Archived Elevation""" & "," & _
"[ArchivedElev],[cboFieldList]=" & """Local 88 Elevation""" &
",[ElevChk],[cboFieldList]=" & """GPS Elevation""" & "," & _
"[ElevGPS],[cboFieldList]=" & """NGS Elevation""" &
",[ElevGPS],[cboFieldList]=" & """""" & ",[Elevation]) AS Elev, * " & _
"FROM PtblBenchmark;"
strSQLsearch = "SELECT PtblBenchmark.BMNum, PtblBenchmark.Name,
PtblBenchmark.Northing, " & _
"PtblBenchmark.Easting, PtblBenchmark.st_name_1,
PtblBenchmark.st_name_2, " & _
"Switch([cboFieldList]=" & """1971 Elevation""" &
",[Elevation],[cboFieldList]=" & """Archived Elevation""" & "," & _
"[ArchivedElev],[cboFieldList]=" & """Local 88 Elevation""" &
",[ElevChk],[cboFieldList]=" & """GPS Elevation""" & "," & _
"[ElevGPS],[cboFieldList]=" & """NGS Elevation""" &
",[ElevGPS],[cboFieldList]=" & """""" & ",[Elevation]) AS Elev, * " & _
"FROM PtblBenchmark " & _
"WHERE (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y1] And [forms]![frmBenchmarkSearch]![Y2]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X1] And
[forms]![frmBenchmarkSearch]![X2])) OR (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y2] And [forms]![frmBenchmarkSearch]![Y1]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X1] And
[forms]![frmBenchmarkSearch]![X2])) OR (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y1] And [forms]![frmBenchmarkSearch]![Y2]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X2] And
[forms]![frmBenchmarkSearch]![X1])) OR (((PtblBenchmark.Northing) Between
[forms]![frmBenchmarkSearch]![Y2] And [forms]![frmBenchmarkSearch]![Y1]) AND
((PtblBenchmark.Easting) Between [forms]![frmBenchmarkSearch]![X2] And
[forms]![frmBenchmarkSearch]![X1]));"