G
Guest
Hello:
This question concerns an Access 2003 Data Project.
I have a list box on a form that my end user is going to use to navigate to
a selected employees record. The end user selects a name from the list and
clicks on a button to navigate to that employee's detail form> Here is the
code I am using:
Private Sub cmdOpenEmployee_Click()
On Error GoTo Err_cmdOpenEmployee_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEmployees"
stLinkCriteria = "[UserID]=" & Me![lstEmployees]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenEmployee_Click:
Exit Sub
Err_cmdOpenEmployee_Click:
MsgBox Err.Description
Resume Exit_cmdOpenEmployee_Click
End Sub
My problem is that whatever employee I first navigate to when the
application is opened, I always get the same employee even though I have gone
back to the list and selected another employee. I have made sure I closed
the search form before opening the detail form. When I open the properties of
the Employee record, it looks as if the entry in the Server Filter box is
somehow getting "stuck".
I have tried a form refresh event when opening the detail record but that
doesn't work. The only way I can get it to work is to close the application
entirely and reopen and select the employee.
Any ideas would be appreciated.
Brennan
This question concerns an Access 2003 Data Project.
I have a list box on a form that my end user is going to use to navigate to
a selected employees record. The end user selects a name from the list and
clicks on a button to navigate to that employee's detail form> Here is the
code I am using:
Private Sub cmdOpenEmployee_Click()
On Error GoTo Err_cmdOpenEmployee_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEmployees"
stLinkCriteria = "[UserID]=" & Me![lstEmployees]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenEmployee_Click:
Exit Sub
Err_cmdOpenEmployee_Click:
MsgBox Err.Description
Resume Exit_cmdOpenEmployee_Click
End Sub
My problem is that whatever employee I first navigate to when the
application is opened, I always get the same employee even though I have gone
back to the list and selected another employee. I have made sure I closed
the search form before opening the detail form. When I open the properties of
the Employee record, it looks as if the entry in the Server Filter box is
somehow getting "stuck".
I have tried a form refresh event when opening the detail record but that
doesn't work. The only way I can get it to work is to close the application
entirely and reopen and select the employee.
Any ideas would be appreciated.
Brennan