G
Gwen H
I used the command button wizard on a form, "MainMenu", to create a button
that opens another form, "Enter_View_Requests". MainMenu has a list box
"empList" with 3 columns. The third column is empID. This is the column I
want to use to filter Enter_View_Requests. Below is the code generated by the
command button wizard. However, when I click the new button,
Enter_View_Requests opens with no records displayed. (Yes I have a record
selected in empList, and there are associated records that should be
displayed on Enter_View_Requests).
Private Sub viewRequests_Click()
On Error GoTo Err_viewRequests_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Enter_View_Requests"
stLinkCriteria = "[empID]=" & Me![empList]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_viewRequests_Click:
Exit Sub
Err_viewRequests_Click:
MsgBox Err.description
Resume Exit_viewRequests_Click
End Sub
The empID field in the table underlying MainMenu is numeric. The empList
field on MainMenu is a list box, so you can't set the format. The empID field
on Enter_View_Requests does not have its format set.
I really, really need some help in figuring out why this isn't working.
Many thanks,
GwenH
that opens another form, "Enter_View_Requests". MainMenu has a list box
"empList" with 3 columns. The third column is empID. This is the column I
want to use to filter Enter_View_Requests. Below is the code generated by the
command button wizard. However, when I click the new button,
Enter_View_Requests opens with no records displayed. (Yes I have a record
selected in empList, and there are associated records that should be
displayed on Enter_View_Requests).
Private Sub viewRequests_Click()
On Error GoTo Err_viewRequests_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Enter_View_Requests"
stLinkCriteria = "[empID]=" & Me![empList]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_viewRequests_Click:
Exit Sub
Err_viewRequests_Click:
MsgBox Err.description
Resume Exit_viewRequests_Click
End Sub
The empID field in the table underlying MainMenu is numeric. The empList
field on MainMenu is a list box, so you can't set the format. The empID field
on Enter_View_Requests does not have its format set.
I really, really need some help in figuring out why this isn't working.
Many thanks,
GwenH