Hey...
I am building a basic transaction program to be used at a Tanning Salon. When a staff member logs off, I want to query the recordset to focus to records for that Staff Member, on that Date, between login/logout times; this will enable calculation of Shift Sales, Packages, Totals...
Here is a rough template of the function that is called when the staff member logs off. I have tested it with acurate records, but to no aval.
*************************
Public Sub CalculateCashOut()
Dim strSQLCashOut As String
Dim intDate As Date
strSQLCashOut = "SELECT TransactionLotion.*, TransactionPackage.*, TransactionLotion.StaffIDFK, TransactionPackage.StaffIDFK, TransactionLotion.OrderDate, TransactionPackage.OrderDate " & _
"From TransactionLotion, TransactionPackage " & _
"WHERE TransactionLotion.StaffIDFK=" & mStaffID & " AND TransactionPackage.StaffIDFK=" & mStaffID & " AND TransactionLotion.OrderDate=" & Date & " AND TransactionPackage.OrderDate=" & Date & " ;"
datCustomerPackage.RecordSource = strSQLCashOut
datCustomerPackage.Refresh
Do While datCustomerPackage.Recordset.EOF = False
If datCustomerPackage.Recordset("TransactionPackage.OrderTime") >= frmLogin.txtFields(2).Text And datCustomerPackage.Recordset("TransactionPackage.OrderTime") <= frmLogin.txtFields(4).Text Then
If datCustomerPackage.Recordset("TransactionLotion.OrderTime").Value >= frmLogin.txtFields(2).Text And datCustomerPackage.Recordset("TransactionLotion.OrderTime") <= frmLogin.txtFields(4).Text Then
MsgBox "You Got Into the Loop", vbOKOnly
End If
End If
Loop
End Sub
*********************
If anyone has any comments, I would be greatly thankful.
Ads
I am building a basic transaction program to be used at a Tanning Salon. When a staff member logs off, I want to query the recordset to focus to records for that Staff Member, on that Date, between login/logout times; this will enable calculation of Shift Sales, Packages, Totals...
Here is a rough template of the function that is called when the staff member logs off. I have tested it with acurate records, but to no aval.
*************************
Public Sub CalculateCashOut()
Dim strSQLCashOut As String
Dim intDate As Date
strSQLCashOut = "SELECT TransactionLotion.*, TransactionPackage.*, TransactionLotion.StaffIDFK, TransactionPackage.StaffIDFK, TransactionLotion.OrderDate, TransactionPackage.OrderDate " & _
"From TransactionLotion, TransactionPackage " & _
"WHERE TransactionLotion.StaffIDFK=" & mStaffID & " AND TransactionPackage.StaffIDFK=" & mStaffID & " AND TransactionLotion.OrderDate=" & Date & " AND TransactionPackage.OrderDate=" & Date & " ;"
datCustomerPackage.RecordSource = strSQLCashOut
datCustomerPackage.Refresh
Do While datCustomerPackage.Recordset.EOF = False
If datCustomerPackage.Recordset("TransactionPackage.OrderTime") >= frmLogin.txtFields(2).Text And datCustomerPackage.Recordset("TransactionPackage.OrderTime") <= frmLogin.txtFields(4).Text Then
If datCustomerPackage.Recordset("TransactionLotion.OrderTime").Value >= frmLogin.txtFields(2).Text And datCustomerPackage.Recordset("TransactionLotion.OrderTime") <= frmLogin.txtFields(4).Text Then
MsgBox "You Got Into the Loop", vbOKOnly
End If
End If
Loop
End Sub
*********************
If anyone has any comments, I would be greatly thankful.
Ads