I coded this, it worked fine until I wanted to print the remaining cash after an evening of indulgence.
I get a division by zero error, whats my problem.
Option Explicit
Private Sub cmdStart_Click()
'Declare required storage
Dim Casinos As Integer
Dim Door_Ch As Currency
Dim Money_Res As Currency
Dim Cash As Currency
Dim Money_Spent As Currency
'ask user to input amount of cash taken out
Cash = InputBox("Please input amount taken ", "Cash to Spend")
Door_Ch = 1 * 6
Money_Res = Cash - Door_Ch - Money_Spent Mod (Casinos 3)
Casinos = Cash - Door_Ch
'Display output in Pic box
picMessage.Print "Door charges paid ", "£"; (Door_Ch)
picMessage.Print "Amount to spend after charges ", "£"; (Cash - Door_Ch)
picMessage.Print "In each casino he spent in casinos ", "£"; (Casinos / 3)
picMessage.Print "The amount he has left is ", "£"; (Money_Res)
End Sub
Beats me.
Thanx
Charlie
I get a division by zero error, whats my problem.
Option Explicit
Private Sub cmdStart_Click()
'Declare required storage
Dim Casinos As Integer
Dim Door_Ch As Currency
Dim Money_Res As Currency
Dim Cash As Currency
Dim Money_Spent As Currency
'ask user to input amount of cash taken out
Cash = InputBox("Please input amount taken ", "Cash to Spend")
Door_Ch = 1 * 6
Money_Res = Cash - Door_Ch - Money_Spent Mod (Casinos 3)
Casinos = Cash - Door_Ch
'Display output in Pic box
picMessage.Print "Door charges paid ", "£"; (Door_Ch)
picMessage.Print "Amount to spend after charges ", "£"; (Cash - Door_Ch)
picMessage.Print "In each casino he spent in casinos ", "£"; (Casinos / 3)
picMessage.Print "The amount he has left is ", "£"; (Money_Res)
End Sub
Beats me.
Thanx
Charlie