H
holmstj via AccessMonster.com
I am trying to move through a recordset at a predetermined timer interval to
display a strip gauge on form that will change value base on row field values
in the recordset. I have run into my limitations of VBA knowledge and need
some help. I thought I might be able to pass the rs back to the timer but it
seem not to work.Please see snippet below:
Private Sub Form_Timer()
'get paramaters from recordsource DFDR Data
BrakeP3 = rsData(rs.Fields("BRAKEPress3"))
rs.MoveNext
'Move bar chart
SetBarChart BrakeP3, 100, 3000
End Sub
Public Function SetBarChart(x As Single, xmin As Single, xmax As Single)
If x <= xmin Then
Me.BarChartBar.Height = 0
ElseIf x >= xmax Then
Me.BarChartBar.Top = Me.BarChartScale.Top
Me.BarChartBar.Height = Me.BarChartScale.Height
Else
Me.BarChartBar.Height = ((x - xmin) / (xmax - xmin)) * Me.
BarChartScale.Height
Me.BarChartBar.Top = Me.BarChartScale.Top + Me.BarChartScale.Height -
Me.BarChartBar.Height
End If
Me.BarChartBar.Visible = True
End Function
Sub rsData(rs As Recordset)
Set rs = CurrentDb.OpenRecordset("DFDR Data", dbOpenForwardOnly)
rs.MoveFirst
End Sub
Variable not defiened error is given when run
Thank for any help and suggestions.
Jeff
display a strip gauge on form that will change value base on row field values
in the recordset. I have run into my limitations of VBA knowledge and need
some help. I thought I might be able to pass the rs back to the timer but it
seem not to work.Please see snippet below:
Private Sub Form_Timer()
'get paramaters from recordsource DFDR Data
BrakeP3 = rsData(rs.Fields("BRAKEPress3"))
rs.MoveNext
'Move bar chart
SetBarChart BrakeP3, 100, 3000
End Sub
Public Function SetBarChart(x As Single, xmin As Single, xmax As Single)
If x <= xmin Then
Me.BarChartBar.Height = 0
ElseIf x >= xmax Then
Me.BarChartBar.Top = Me.BarChartScale.Top
Me.BarChartBar.Height = Me.BarChartScale.Height
Else
Me.BarChartBar.Height = ((x - xmin) / (xmax - xmin)) * Me.
BarChartScale.Height
Me.BarChartBar.Top = Me.BarChartScale.Top + Me.BarChartScale.Height -
Me.BarChartBar.Height
End If
Me.BarChartBar.Visible = True
End Function
Sub rsData(rs As Recordset)
Set rs = CurrentDb.OpenRecordset("DFDR Data", dbOpenForwardOnly)
rs.MoveFirst
End Sub
Variable not defiened error is given when run
Thank for any help and suggestions.
Jeff