chewy
SuperNintendo Chalmers
- Local time
- Today, 20:43
- Joined
- Mar 8, 2002
- Messages
- 581
Why wont this display mySum as currency?
Private Sub Command16_Click()
Dim mycount As Variant
Dim strSQL As String
Dim mySum As Currency
'checks to see if the start date comes after the end date for error checking purposes
If StartDate > EndDate Then
'error that start comes after end date
MsgBox StartDate & " is after " & EndDate & vbCrLf & "Start date can not be after End date" & vbCrLf & vbCrLf & vbCrLf & "Change before you can proceed!", vbExclamation, "Date Error"
Else
'sets the string to the start date and end date to query from
strSQL = "SELECT * FROM qryMain WHERE Date BETWEEN #" & StartDate & "# AND #" & EndDate & "#"
'count the number of record in the query (*Note it is the qryCount NOT qryMain*)
mycount = DCount("[CustomerID]", "qryCount")
mySum = DSum("[CheckAmount]", "qryCount")
'displays the number of records and the charge for the checks in the time period
MsgBox "The number of checks processed during " & Me.StartDate & " and " & Me.EndDate & " is: " & vbCrLf & vbCrLf & vbTab & vbTab & vbTab & " ******* " & mycount & " *******" _
& vbCrLf & vbCrLf & vbTab & " ***** " & "Amount to charge for all checks: " & (mycount * 0.3) & "¢ *****" _
& vbCrLf & vbCrLf & vbTab & " ***** " & "Total Checks total: " & mySum & " *****"
End If
End Sub
it is just outputting it as 234532.98
Any ideas? Or do you need more info?
Private Sub Command16_Click()
Dim mycount As Variant
Dim strSQL As String
Dim mySum As Currency
'checks to see if the start date comes after the end date for error checking purposes
If StartDate > EndDate Then
'error that start comes after end date
MsgBox StartDate & " is after " & EndDate & vbCrLf & "Start date can not be after End date" & vbCrLf & vbCrLf & vbCrLf & "Change before you can proceed!", vbExclamation, "Date Error"
Else
'sets the string to the start date and end date to query from
strSQL = "SELECT * FROM qryMain WHERE Date BETWEEN #" & StartDate & "# AND #" & EndDate & "#"
'count the number of record in the query (*Note it is the qryCount NOT qryMain*)
mycount = DCount("[CustomerID]", "qryCount")
mySum = DSum("[CheckAmount]", "qryCount")
'displays the number of records and the charge for the checks in the time period
MsgBox "The number of checks processed during " & Me.StartDate & " and " & Me.EndDate & " is: " & vbCrLf & vbCrLf & vbTab & vbTab & vbTab & " ******* " & mycount & " *******" _
& vbCrLf & vbCrLf & vbTab & " ***** " & "Amount to charge for all checks: " & (mycount * 0.3) & "¢ *****" _
& vbCrLf & vbCrLf & vbTab & " ***** " & "Total Checks total: " & mySum & " *****"
End If
End Sub
it is just outputting it as 234532.98
Any ideas? Or do you need more info?