G
Gwen H
I have two forms, MainMenu and Enter_View_Requests. MainMenu has a button
that opens Enter_View_Requests and finds a specific record. I used the button
wizard to create the code for this, so I'm pretty sure it's correct, but here
it is:
'Button to view requests for a specific employee
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
When I click this button, it opens Enter_View_Requests, but it displays no
records, even if there are records that should be displayed. Here's the code
that runs when the form opens:
'Maximize the form when it is opened, display message box if no records found
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
Forms.Item("MainMenu").Visible = False
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No requests for this employee since January 1, 2006.", , "No
Records Found"
Me.FilterOn = True
End If
End Sub
Any idea why Enter_View_Requests displays no records, when it should display
at least one?
Many thanks!
GwenH
that opens Enter_View_Requests and finds a specific record. I used the button
wizard to create the code for this, so I'm pretty sure it's correct, but here
it is:
'Button to view requests for a specific employee
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
When I click this button, it opens Enter_View_Requests, but it displays no
records, even if there are records that should be displayed. Here's the code
that runs when the form opens:
'Maximize the form when it is opened, display message box if no records found
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
Forms.Item("MainMenu").Visible = False
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No requests for this employee since January 1, 2006.", , "No
Records Found"
Me.FilterOn = True
End If
End Sub
Any idea why Enter_View_Requests displays no records, when it should display
at least one?
Many thanks!
GwenH