Connecting Tech Pros Worldwide Forums | Help | Site Map

How can I add another sum column here to be placed on another text box?

Newbie
 
Join Date: Oct 2009
Posts: 3
#1: Oct 14 '09
Here is my code and its finally working. my only problem now. is how can i add another column to add. and put it to another textbox


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3. Dim MyCon As New ADODB.Connection
  4. Dim jai As New ADODB.Recordset
  5. Dim sConnect As String
  6.  
  7.  
  8. sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  9. "Data Source=" & _
  10. App.Path & "\db1.mdb"
  11.  
  12. MyCon.Open sConnect
  13. jai.Open "select sum(t15) from survey", MyCon, adOpenDynamic, adLockPessimistic
  14. txt15.Text = jai.Fields(0)
  15. jai.Close
  16. MyCon.Close
  17.  
  18.  
  19. End Sub
  20.  
  21.  

Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,268
#2: 2 Weeks Ago

re: How can I add another sum column here to be placed on another text box?


That's half the battle, jairus2... Can you simply go to design mode in your db and add a column there, then in VB you can say Text16...

How 'bout that?
Reply