First, I have built a db logger that records all data changes to a record. What I want to do is have a button on a form that pulls the history of the current record being displayed.
In other words, I open the form, find the record that I am looking for, and if I want to see the history for that record I press a button and when the query runs it automatically filters for the record number that is currently displayed on the form. Instead of bringing up a message box asking for the record number.
Here is my code for those who can help:
Any and all suggestions are greatly appreciated.
FYI - The field name of the record number is 'Incident_Number'.
Travis
"Why would I ever want to learn about programming when Micorsoft products would be able to handle even the simplest of tasks. Oh...wait a minute...something's wrong with that statement?!
In other words, I open the form, find the record that I am looking for, and if I want to see the history for that record I press a button and when the query runs it automatically filters for the record number that is currently displayed on the form. Instead of bringing up a message box asking for the record number.
Here is my code for those who can help:
Code:
Private Sub Record_History_Click()
On Error GoTo Err_Record_History_Click
Dim stDocName As String
stDocName = "tblDbLog Query"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Record_History_Click:
Exit Sub
Err_Record_History_Click:
MsgBox Err.Description
Resume Exit_Record_History_Click
End Sub
Any and all suggestions are greatly appreciated.
FYI - The field name of the record number is 'Incident_Number'.
Travis
"Why would I ever want to learn about programming when Micorsoft products would be able to handle even the simplest of tasks. Oh...wait a minute...something's wrong with that statement?!