D
Dave Elliott
This code is used to pay an employee, after clicking on the field CheckNo it
runs the code and a check number is entered and then after selecting
another record manually, that is by clicking on next record you do the same
and so on until you have selected all employees to pay.The employee is
marked as paid as well.
The initial check number is set via another form before you enter this
form.Then you have a starting check number.What I cant figure out is how to
make it auto advance, that is upon click, increment the check number by one
for all the records in one swift click.The check counter works fine except
that I can only do it one record at a time. The code below is split into two
parts, One, the first is used to auto input the check number, save the
record and the run the next section of code, which pays the employee and
advances to the first record. Hope this makes sense. I just want it to enter
the check number into all the records instead of one at a time so I can
batch print them.
Thanks,
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FSubHours"
If IsNull(Me.CheckDate) Then
Me.CheckDate = Date
End If
If IsNull(Me.[CheckNo]) Then
Me.[CheckNo] = Next_Custom_Counter
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
________________________________________________________________
Forms!FSubHours.Visible = False
DoCmd.GoToRecord , , acFirst
Do Until IsNull([Work Date])
Me.[CheckNo] = [Forms]![FEmpTotHours].[Payroll Check].Form.[CheckNo]
Me.[CheckDate] = [Forms]![FEmpTotHours].[Payroll Check].Form.[CheckDate]
Me.[ChkNoID] = [Forms]![FEmpTotHours].[Payroll Check].Form.[ChkNoID]
Me.[Paid] = -1
Me.[BeginDate] = [Forms]![frmautopayrollreport]![BeginDate]
Me.[EndDate] = [Forms]![frmautopayrollreport]![EndDate]
DoCmd.GoToRecord , , acNext
Loop
[Forms]![FEmpTotHours].Requery
''DoCmd.SetWarnings False
''If [Forms]![FEmpTotHours]![EmpOrCon] = 1 Then
'DoCmd.OpenQuery "QEmpTotHoursAUpdate", acNormal
''ElseIf [Forms]![FEmpTotHours]![EmpOrCon] = 2 Then
''DoCmd.OpenQuery "QEmpTotHoursHourlyConUpDate", acNormal
''ElseIf [Forms]![FEmpTotHours]![EmpOrCon] = 3 Then
''DoCmd.OpenQuery "QEmpTotHoursPerJobConUpDate", acNormal
''DoCmd.SetWarnings True
''End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Close
--
---------------------------------------------------------------------
This email and any files transmitted with it from Dave Elliott are
confidential and intended solely for the
use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the
sender.
All Mail is pre-scanned with Norton Antivirus 2004 for your protection.
http://[email protected]
runs the code and a check number is entered and then after selecting
another record manually, that is by clicking on next record you do the same
and so on until you have selected all employees to pay.The employee is
marked as paid as well.
The initial check number is set via another form before you enter this
form.Then you have a starting check number.What I cant figure out is how to
make it auto advance, that is upon click, increment the check number by one
for all the records in one swift click.The check counter works fine except
that I can only do it one record at a time. The code below is split into two
parts, One, the first is used to auto input the check number, save the
record and the run the next section of code, which pays the employee and
advances to the first record. Hope this makes sense. I just want it to enter
the check number into all the records instead of one at a time so I can
batch print them.
Thanks,
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FSubHours"
If IsNull(Me.CheckDate) Then
Me.CheckDate = Date
End If
If IsNull(Me.[CheckNo]) Then
Me.[CheckNo] = Next_Custom_Counter
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
________________________________________________________________
Forms!FSubHours.Visible = False
DoCmd.GoToRecord , , acFirst
Do Until IsNull([Work Date])
Me.[CheckNo] = [Forms]![FEmpTotHours].[Payroll Check].Form.[CheckNo]
Me.[CheckDate] = [Forms]![FEmpTotHours].[Payroll Check].Form.[CheckDate]
Me.[ChkNoID] = [Forms]![FEmpTotHours].[Payroll Check].Form.[ChkNoID]
Me.[Paid] = -1
Me.[BeginDate] = [Forms]![frmautopayrollreport]![BeginDate]
Me.[EndDate] = [Forms]![frmautopayrollreport]![EndDate]
DoCmd.GoToRecord , , acNext
Loop
[Forms]![FEmpTotHours].Requery
''DoCmd.SetWarnings False
''If [Forms]![FEmpTotHours]![EmpOrCon] = 1 Then
'DoCmd.OpenQuery "QEmpTotHoursAUpdate", acNormal
''ElseIf [Forms]![FEmpTotHours]![EmpOrCon] = 2 Then
''DoCmd.OpenQuery "QEmpTotHoursHourlyConUpDate", acNormal
''ElseIf [Forms]![FEmpTotHours]![EmpOrCon] = 3 Then
''DoCmd.OpenQuery "QEmpTotHoursPerJobConUpDate", acNormal
''DoCmd.SetWarnings True
''End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Close
--
---------------------------------------------------------------------
This email and any files transmitted with it from Dave Elliott are
confidential and intended solely for the
use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the
sender.
All Mail is pre-scanned with Norton Antivirus 2004 for your protection.
http://[email protected]