G
Guest
Hi i have a form which shows which items are Red status, via a list. the list
runs of a query which only pulls in the latest week. To go to the correct
record i have a find button (see below) except this does not work, it pulls
in all the records in that location. I would like it just to pull in the
latest one. Or if this is not possible then any within the last 7 days.
I cannot use the record number as the database uses random key numbers, and
i cannot change this
Private Sub Find_Red_Button_Click()
On Error GoTo Err_Find_Red_Button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "AuditMainFrm"
stLinkCriteria = "[LocCode]=" & "'" & Me![Red List] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Find_Red_Button_Click:
Exit Sub
Err_Find_Red_Button_Click:
MsgBox Err.Description
Resume Exit_Find_Red_Button_Click
End Sub
runs of a query which only pulls in the latest week. To go to the correct
record i have a find button (see below) except this does not work, it pulls
in all the records in that location. I would like it just to pull in the
latest one. Or if this is not possible then any within the last 7 days.
I cannot use the record number as the database uses random key numbers, and
i cannot change this
Private Sub Find_Red_Button_Click()
On Error GoTo Err_Find_Red_Button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "AuditMainFrm"
stLinkCriteria = "[LocCode]=" & "'" & Me![Red List] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Find_Red_Button_Click:
Exit Sub
Err_Find_Red_Button_Click:
MsgBox Err.Description
Resume Exit_Find_Red_Button_Click
End Sub