Loop thru Combobox Assistance

mardi 17 mars 2015

The below code runs on a command button. cmdrotate

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

0 commentaires:

Enregistrer un commentaire

Labels