Juan Amore
October 19th, 2001, 11:02 AM
Does anyone know how to use these "amt" "temp"
commands.I have a program which calculates a salesman's commission + basepay.
After inputing several times I'm suppose use another Menu button;ie summary and get the totals
from these compounding inputs. Under my form section;I have these "amt" "temp" variables set as
Private Sub Form_Load()
'Set 3 temp files used for total summary
Static SalesNum As String
Static CommNum As String
Static TotalNum As String
Static AmtSalesTemp As Currency
Static AmtCommTemp As Currency
Static AmtTotalTemp As Currency
Static AmtSales As Currency
Static AmtComm As Currency
Static AmtTotal As Currency
'Set 3 constants
Const rate = 0.15
Const base = 250
Const quota = 999
End Sub
Then In my Menu Button section for me to display this information and for it to add up I have;
Private Sub mnuSummary_Click()
'Set 3 constants
Const rate = 0.15
Const base = 250
Const quota = 999
If IsNumeric(txt2.Text) Then
AmtSalesTemp = txt2.Text
Else
MsgBox "No Data to Summarize", vbOKOnly, "Commission"
End If
If AmtSalesTemp >= quota Then
AmtCommTemp = AmtSalesTemp * rate
AmtTotalTemp = AmtCommTemp + base
SalesNum = AmtSalesTemp + AmtSales
CommNum = AmtCommTemp + AmtComm
TotalNum = AmtTotalTemp + AmtTotal
MsgBox "Total Pay = $" & Format$(TotalNum, ".00") & vbCrLf & "Total Commission=$" & Format$(CommNum, ".00") & vbCrLf & "Total Sales=$" & Format$(SalesNum, ".00"), vbOKOnly, "Summary"
Else
MsgBox "Total Pay = $" & Format$(base, ".00") & vbCrLf & "Total Commission=$" & Format$(CommNum, ".00") & vbCrLf & "Total Sales=$" & Format$(SalesNum, ".00"), vbOKOnly, "Summary"
End If
End Sub
As you can see I trying to send these totals via
a Msg Box but I can't get these "amt" and "temp"
commands to cause the information to "store!"
I even used Static in place of Dim hopeing this would do the trick but no luck,,,,I just don't know what to do...Please anyone HELP!!!:)
Juan Amore
commands.I have a program which calculates a salesman's commission + basepay.
After inputing several times I'm suppose use another Menu button;ie summary and get the totals
from these compounding inputs. Under my form section;I have these "amt" "temp" variables set as
Private Sub Form_Load()
'Set 3 temp files used for total summary
Static SalesNum As String
Static CommNum As String
Static TotalNum As String
Static AmtSalesTemp As Currency
Static AmtCommTemp As Currency
Static AmtTotalTemp As Currency
Static AmtSales As Currency
Static AmtComm As Currency
Static AmtTotal As Currency
'Set 3 constants
Const rate = 0.15
Const base = 250
Const quota = 999
End Sub
Then In my Menu Button section for me to display this information and for it to add up I have;
Private Sub mnuSummary_Click()
'Set 3 constants
Const rate = 0.15
Const base = 250
Const quota = 999
If IsNumeric(txt2.Text) Then
AmtSalesTemp = txt2.Text
Else
MsgBox "No Data to Summarize", vbOKOnly, "Commission"
End If
If AmtSalesTemp >= quota Then
AmtCommTemp = AmtSalesTemp * rate
AmtTotalTemp = AmtCommTemp + base
SalesNum = AmtSalesTemp + AmtSales
CommNum = AmtCommTemp + AmtComm
TotalNum = AmtTotalTemp + AmtTotal
MsgBox "Total Pay = $" & Format$(TotalNum, ".00") & vbCrLf & "Total Commission=$" & Format$(CommNum, ".00") & vbCrLf & "Total Sales=$" & Format$(SalesNum, ".00"), vbOKOnly, "Summary"
Else
MsgBox "Total Pay = $" & Format$(base, ".00") & vbCrLf & "Total Commission=$" & Format$(CommNum, ".00") & vbCrLf & "Total Sales=$" & Format$(SalesNum, ".00"), vbOKOnly, "Summary"
End If
End Sub
As you can see I trying to send these totals via
a Msg Box but I can't get these "amt" and "temp"
commands to cause the information to "store!"
I even used Static in place of Dim hopeing this would do the trick but no luck,,,,I just don't know what to do...Please anyone HELP!!!:)
Juan Amore