The below code runs on a command button. cmdrotate
What happens is that it only creates 1 Employee and code stops?
What happens is that it only creates 1 Employee and code stops?
Quote:
Me.EmpID.SetFocus 'Set Focus on Employee field If Not IsNull(Me.EmpID) Then 'Is already a Employee DoCmd.GoToRecord , "", acNext ElseIf IsNull(Me.EmpID) Then 'Is Not a Employee EmpID.ListIndex = EmpID.ListIndex + 1 'Create a Employee Call EmpID_AfterUpdate 'Create Start and End Dates End If Do Until IsNull([EmpID]) 'Run Until All Employees Have Been Scheduled If Me.EmpID.ListIndex <> EmpID.ListCount - 1 Then 'Is Not a Employee EmpID.ListIndex = EmpID.ListIndex + 1 'Create a Employee Else EmpID.ListIndex = 0 'Do Not Create a Employee End If Call EmpID_AfterUpdate 'Create Start and End Dates Me.Dirty = False 'Save Record DoCmd.GoToRecord , , acNext 'Next Record Loop 'Continue Until No More Employees |
Loop thru Combobox Assistance