Hi.
I'm little stuck here, and I hope I could get some input..
On a pushbutton click event, I have the following code:
Private Sub cmdTest1_Click()
Dim rsCable As ADODB.Recordset
Set rsCable = New ADODB.Recordset
rsCable.ActiveConnection = CurrentProject.Connection
rsCable.Open "SELECT Sum(Cable.Meter) AS SumAvMeter FROM Cable"
Me.txtResult = 'Here I would like the result of the query above
End Sub
I know this is wrong, but I just don't know how to use a simplest way to sumarize all value in the table field Cable.Meter above. Today I'm using a Do While loop, sumarizing all values, but in more than 10000 records, this takes time...
So the question are, how can I use Select Sum in this scenario?
- Geirr.
I'm little stuck here, and I hope I could get some input..
On a pushbutton click event, I have the following code:
Private Sub cmdTest1_Click()
Dim rsCable As ADODB.Recordset
Set rsCable = New ADODB.Recordset
rsCable.ActiveConnection = CurrentProject.Connection
rsCable.Open "SELECT Sum(Cable.Meter) AS SumAvMeter FROM Cable"
Me.txtResult = 'Here I would like the result of the query above
End Sub
I know this is wrong, but I just don't know how to use a simplest way to sumarize all value in the table field Cable.Meter above. Today I'm using a Do While loop, sumarizing all values, but in more than 10000 records, this takes time...
So the question are, how can I use Select Sum in this scenario?
- Geirr.