D
DylanN
I have been trying unsuccessfully for the past coupla' hours to figure out
this error
I've changed data types in the tables and the form to no avail..
Does anyone have a solution to troubleshoot this error...
Option Compare Database
Option Explicit
Private Sub Command29_Click()
Dim db As Database
Dim recset As Recordset
Dim amount As Single
Dim qty As Single
Dim cost As Currency
Dim sum As String
On Error GoTo Errhandler
Set recset = CurrentDb.OpenRecordset("SELECT * FROM MEDICINE")
recset.MoveFirst
While Not recset
sum = 0
amount = 0
qty = recset!Field("MED_ONHAND")
cost = recset!Field("MED_UNITPRICE")
amount = qty * cost
sum = sum + amount
recset.MoveFirst
Wend
MsgBox ("Value of medicine on hand = $" & sum)
Errhandler:
MsgBox ("Error in Process '" + Error(Err) + "'" + qty + " " +
cost)
recset.Close
Exit Sub
End Sub
this error
I've changed data types in the tables and the form to no avail..
Does anyone have a solution to troubleshoot this error...
Option Compare Database
Option Explicit
Private Sub Command29_Click()
Dim db As Database
Dim recset As Recordset
Dim amount As Single
Dim qty As Single
Dim cost As Currency
Dim sum As String
On Error GoTo Errhandler
Set recset = CurrentDb.OpenRecordset("SELECT * FROM MEDICINE")
recset.MoveFirst
While Not recset
sum = 0
amount = 0
qty = recset!Field("MED_ONHAND")
cost = recset!Field("MED_UNITPRICE")
amount = qty * cost
sum = sum + amount
recset.MoveFirst
Wend
MsgBox ("Value of medicine on hand = $" & sum)
Errhandler:
MsgBox ("Error in Process '" + Error(Err) + "'" + qty + " " +
cost)
recset.Close
Exit Sub
End Sub