LeeSmith
Registered User.
- Local time
- Today, 20:45
- Joined
- Mar 17, 2006
- Messages
- 27
Hi
Apologies if this has been answered before, but I cant find it anywhere.
I am currently trying to open a form and show records on a specific date. I have created a form which isn't bound to a table and has one field for the date which is being searched for and a button to open the form that has been entered.
Im using the code below, but when I enter a date and click on the button, the form that it opens appears blank. I have checked multiple times and there are definitely records for the date I am searching for. Could anyone help shed any light on this for me or suggest a better way that I could do this?
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmRecordsByDate"
stLinkCriteria = "[Date]=" & "#" & Me![datSearch] & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
Apologies if this has been answered before, but I cant find it anywhere.
I am currently trying to open a form and show records on a specific date. I have created a form which isn't bound to a table and has one field for the date which is being searched for and a button to open the form that has been entered.
Im using the code below, but when I enter a date and click on the button, the form that it opens appears blank. I have checked multiple times and there are definitely records for the date I am searching for. Could anyone help shed any light on this for me or suggest a better way that I could do this?
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmRecordsByDate"
stLinkCriteria = "[Date]=" & "#" & Me![datSearch] & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub