I need help writing a line of code that creates a new record and populates a combo box with the next item on the list.
I have a form for employee time that has a combo box with employee names and a subform for the time punches linked to the employee. The combo box is bound to the employee id numbers.
I used the following code but Access does not make things as simple as I think it should be.
EmpID = Me.Employee.ListIndex 'Current Employee
DoCmd.GoToRecord , , acNewRec 'Create New Record
Me.Employee.ListIndex = EmpID + 1 'Next Employee
The first line works and so does the second. I used a msgbox to display the EmpID and it was right every time. But the listindex seems to be read only.
What is the easy way to perform this action.
I have a form for employee time that has a combo box with employee names and a subform for the time punches linked to the employee. The combo box is bound to the employee id numbers.
I used the following code but Access does not make things as simple as I think it should be.
EmpID = Me.Employee.ListIndex 'Current Employee
DoCmd.GoToRecord , , acNewRec 'Create New Record
Me.Employee.ListIndex = EmpID + 1 'Next Employee
The first line works and so does the second. I used a msgbox to display the EmpID and it was right every time. But the listindex seems to be read only.
What is the easy way to perform this action.