G
Gator
I want Text27 to show SUM of all the numbers in the Field 'Amount' in Table
'Deposits' based on the value of List7.Column(2) that is selected on each
click event on List7. Below is the code I have tried (Compile error:
Type-declaration character does not match declared data type) at the Line
beginning with "Me!Text27=". There may be better ways to do it and if there
are, I'm game. Keep in mind I have much to learn so help me as much as
possible. thanks
Private Sub List7_Click()
Me.Text11.Value = List7.Column(1)
Me.Text13.Value = List7.Column(2)
Me.Text15.Value = List7.Column(3)
Dim mycon As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set mycon = CurrentProject.Connection
rs.Open "TreasurerDepositsQuery", mycon, adOpenKeyset, adLockBatchOptimistic
rs.Find "Fund='" & Me!List7.Column(2) & "'"
Me!Text27 = rs!(DSum("Amount", "Deposits"))
rs.Close
mycon.Close
End Sub
'Deposits' based on the value of List7.Column(2) that is selected on each
click event on List7. Below is the code I have tried (Compile error:
Type-declaration character does not match declared data type) at the Line
beginning with "Me!Text27=". There may be better ways to do it and if there
are, I'm game. Keep in mind I have much to learn so help me as much as
possible. thanks
Private Sub List7_Click()
Me.Text11.Value = List7.Column(1)
Me.Text13.Value = List7.Column(2)
Me.Text15.Value = List7.Column(3)
Dim mycon As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set mycon = CurrentProject.Connection
rs.Open "TreasurerDepositsQuery", mycon, adOpenKeyset, adLockBatchOptimistic
rs.Find "Fund='" & Me!List7.Column(2) & "'"
Me!Text27 = rs!(DSum("Amount", "Deposits"))
rs.Close
mycon.Close
End Sub