|
-
May 17th, 2006, 05:07 AM
#1
Thread Starter
Fanatic Member
[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:
Private Sub cmdShowTotal_Click()
Dim GR84Total As Long
GR84Total = 0
rs.MoveFirst
Do Until rs.EOF
GR84Total = GR84Total + rs("GR84")
rs.MoveNext
Loop
Me.txtShowTotal = GR84Total
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
-
May 17th, 2006, 05:46 AM
#2
Re: Need to get the total, but datatype prevents it...
-
May 17th, 2006, 06:13 AM
#3
Thread Starter
Fanatic Member
Re: Need to get the total, but datatype prevents it...
 Originally Posted by Hack
Hi, Hack! It works fantastic. Thanks for your kind help as usual.
Regards.
Seema_S
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|