Q
Qdxss2b via AccessMonster.com
I am trying to add new info to a combo box list.
On a form called frmGenInfo which lists Employees, work sites, and general
information about the employee.
This is based a table called tblUpdates.
It draws from 3 tables, tblEmployee, tblWorkSite, tblGenInfo.
I have put a command button on the form so that I can add a new employee.
This is on the click command:
(I have skipped putting in the error handling lines)
Private Sub cmdAddEmployee_Click()
Dim NbrEmployeeID As Long
If IsNull (EmployeeID) Then
EmployeeID = ""
Else
NbrEmployeeID = EmployeeID
EmployeeID = Null
End If
Do.Cmd.Open Form "frmEmployee", , , , , AcWindowMode.acDialog, "GotoNew"
EmployeeID.Requery
If NbrEmployeeID <> 0 Then
EmployeeID = NbrEmployeeID
End If
End Sub
The problem is that when it opens the form, it does not go to a new record.
It opens and goes to the first record in the table tblEmployee.
What am I doing wrong?
Thank you for any help.
On a form called frmGenInfo which lists Employees, work sites, and general
information about the employee.
This is based a table called tblUpdates.
It draws from 3 tables, tblEmployee, tblWorkSite, tblGenInfo.
I have put a command button on the form so that I can add a new employee.
This is on the click command:
(I have skipped putting in the error handling lines)
Private Sub cmdAddEmployee_Click()
Dim NbrEmployeeID As Long
If IsNull (EmployeeID) Then
EmployeeID = ""
Else
NbrEmployeeID = EmployeeID
EmployeeID = Null
End If
Do.Cmd.Open Form "frmEmployee", , , , , AcWindowMode.acDialog, "GotoNew"
EmployeeID.Requery
If NbrEmployeeID <> 0 Then
EmployeeID = NbrEmployeeID
End If
End Sub
The problem is that when it opens the form, it does not go to a new record.
It opens and goes to the first record in the table tblEmployee.
What am I doing wrong?
Thank you for any help.