Results 1 to 3 of 3

Thread: [RESOLVED] Need to get the total, but datatype prevents it...

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Resolved [RESOLVED] Need to get the total, but datatype prevents it...

    Hi,

    I am facing the following problem. Please help me.

    I am using MS Access database. The field GR84 has set to Text data Type. All the data entered in GR84 is in numeric. Now, I would like to calculate the Total of GR84 in a textbox. The following is the code. I am getting the type mismatch error. I think because the data type in database is Text, its showing that error. How to proceed without changing the data type in database?

    VB Code:
    1. Private Sub cmdShowTotal_Click()
    2.  
    3. Dim GR84Total As Long
    4. GR84Total = 0
    5. rs.MoveFirst
    6. Do Until rs.EOF
    7. GR84Total = GR84Total + rs("GR84")
    8. rs.MoveNext
    9. Loop
    10. Me.txtShowTotal = GR84Total
    11. End Sub

    Regards.

    Seema_s
    Last edited by Hack; May 17th, 2006 at 07:14 AM. Reason: Added [RESOLVED] to thread title and green "resolved" checkmark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width