J
jtertin
I am VERY close to having this working, but keep getting hung up at
the very end.
I have an Access database with several linked SQL tables and views.
I am using the results of three drop downs (SYSTEM, PHASE, and BATCH)
to dynamically change the source of an Access query to different SQL
linked views.
This routine changes the query text of "ChartData" to "SELECT * FROM
dbo_vw_Analogs_S02WP WHERE BatchID='1';" (Provided 02, WP, and 1 are
the values of the drop downs):
===========================================
Private Sub cboBatch_Change()
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String
strSQL = "SELECT * FROM dbo_vw_Analogs_S" & Forms!GetChart!
cbosystem & Forms!GetChart!cboPhase & " WHERE BatchID='" & Forms!
GetChart!cboBatch & "';"
'MsgBox (strSQL)
Set qdfCurr = CurrentDb().QueryDefs("ChartData")
qdfCurr.SQL = strSQL
End Sub
===========================================
I am trying to create a chart with the RecordSet being the above query
results. Because the number of columns returned by the above may
change, I cannot statically define columns to use in the chart. I
have tried the following using an MSChart object. This works GREAT
with the ONE exception of not being able to handle a DateTime data
type on the X-Axis.
As a work-around to that problem, I can cast all of the dates as
VARCHARs in the SQL view, which allows them to be displayed. The only
problem with this is that STRING values do not AUTOSCALE, so they
overlap something terrible when I trend more than ~50 points.
===========================================
Private Sub Form_Load()
Dim con As Object
Dim ChartRecordset As New ADODB.Recordset 'Object
Dim MaxDate As Date
Set con = Application.CurrentProject.Connection
'Set ChartRecordset = CreateObject("ADODB.Recordset")
ChartRecordset.Open "SELECT * from [ChartData]", con, adOpenStatic,
adLockOptimistic
With Chart
Set .DataSource = ChartRecordset
.ShowLegend = True
.Title = "System " & Forms!GetChart!cbosystem & " " & Forms!
GetChart!cboPhase.Column(1) & ", " & "Batch: " & Forms!GetChart!
cboBatch & " Ending: [MAX DATETIME]"
End With
End Sub
===========================================
I am SO close to getting this working, but am getting hung up. I have
tried the OWA chart control with little success - it does not seem to
like dynamic data very much - though if someone could provide a
reference using it I could probably get it to work.
Any help is greatly appreciated!
the very end.
I have an Access database with several linked SQL tables and views.
I am using the results of three drop downs (SYSTEM, PHASE, and BATCH)
to dynamically change the source of an Access query to different SQL
linked views.
This routine changes the query text of "ChartData" to "SELECT * FROM
dbo_vw_Analogs_S02WP WHERE BatchID='1';" (Provided 02, WP, and 1 are
the values of the drop downs):
===========================================
Private Sub cboBatch_Change()
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String
strSQL = "SELECT * FROM dbo_vw_Analogs_S" & Forms!GetChart!
cbosystem & Forms!GetChart!cboPhase & " WHERE BatchID='" & Forms!
GetChart!cboBatch & "';"
'MsgBox (strSQL)
Set qdfCurr = CurrentDb().QueryDefs("ChartData")
qdfCurr.SQL = strSQL
End Sub
===========================================
I am trying to create a chart with the RecordSet being the above query
results. Because the number of columns returned by the above may
change, I cannot statically define columns to use in the chart. I
have tried the following using an MSChart object. This works GREAT
with the ONE exception of not being able to handle a DateTime data
type on the X-Axis.
As a work-around to that problem, I can cast all of the dates as
VARCHARs in the SQL view, which allows them to be displayed. The only
problem with this is that STRING values do not AUTOSCALE, so they
overlap something terrible when I trend more than ~50 points.
===========================================
Private Sub Form_Load()
Dim con As Object
Dim ChartRecordset As New ADODB.Recordset 'Object
Dim MaxDate As Date
Set con = Application.CurrentProject.Connection
'Set ChartRecordset = CreateObject("ADODB.Recordset")
ChartRecordset.Open "SELECT * from [ChartData]", con, adOpenStatic,
adLockOptimistic
With Chart
Set .DataSource = ChartRecordset
.ShowLegend = True
.Title = "System " & Forms!GetChart!cbosystem & " " & Forms!
GetChart!cboPhase.Column(1) & ", " & "Batch: " & Forms!GetChart!
cboBatch & " Ending: [MAX DATETIME]"
End With
End Sub
===========================================
I am SO close to getting this working, but am getting hung up. I have
tried the OWA chart control with little success - it does not seem to
like dynamic data very much - though if someone could provide a
reference using it I could probably get it to work.
Any help is greatly appreciated!