Say I have a forum with a date text box. I want create a table that logs if and when that field is changed. Is it possible to create an event procedure that populates a row of data on a separate table.
Say I have a forum with a date text box. I want create a table that logs if and when that field is changed. Is it possible to create an event procedure that populates a row of data on a separate table.
Why do you want to do this? Why not just have a date field in the bound table?
Either way you can use code
Code:Private Sub [event] Dim rs as DAO.RecordSet rs = CurrentDb.OpenRecordSet("TableName") 'name of table you are writing to rs.Fields("FieldName") = Me![formControlWithDate] 'this is the name of the control with the data you want to write in rs.Close rs = Nothing End Sub
Thank you.Why do you want to do this? Why not just have a date field in the bound table?
Either way you can use code
Code:Private Sub [event] Dim rs as DAO.RecordSet rs = CurrentDb.OpenRecordSet("TableName") 'name of table you are writing to rs.Fields("FieldName") = Me![formControlWithDate] 'this is the name of the control with the data you want to write in rs.Close rs = Nothing End Sub
I'm doing this because the new table won't populate with the date entered in the date field.
So there are two tables. One table is bound to the form. That will store the date information. The second table is not bound to the form, and that's the one I want to populate with the event procedure. The second table will basically be a change log. I want to know whenever the field on the form is changed. So each time the date is changed on the form, the second table will record the time, the record entry # (from the first table), the name of the person making the change (every person who uses this database has to log in), and the new value.
I think your coding works. Thank you again.
I see what you mean now. Makes much more sense. If anything else comes up post back.