UncleBulgaria
New member
- Local time
- Today, 15:50
- Joined
- Jun 12, 2008
- Messages
- 9
I have a database that has data input on one main form that contains various sub-forms for different data types in various tables, all connected via an ID code.
On one of the sub-forms, I wanted it to automatically collect a record updated date. I have added the relevant field to the table behind the form, and have added the field to the relevant sub-form (albeit not visible). I perhaps should also mention there may be more than one record per ID code. The sub-form worked perfectly before I started all of this and added the following VBA code:
Private Sub Form_AfterUpdate()
Me.Record_Amend_Date = Now()
End Sub
Now when I amend data it will not let me move to the next record, and if I try to close it throws up a message box saying that:
Does anybody know why it is doing this and how to get it so I can amend data and then move to the next record?
Thank you for your help.
Regards,
Robert.
On one of the sub-forms, I wanted it to automatically collect a record updated date. I have added the relevant field to the table behind the form, and have added the field to the relevant sub-form (albeit not visible). I perhaps should also mention there may be more than one record per ID code. The sub-form worked perfectly before I started all of this and added the following VBA code:
Private Sub Form_AfterUpdate()
Me.Record_Amend_Date = Now()
End Sub
'You can't save this record at this time. Microsoft Office Access may have encountered an errorwhile trying to save a record. If you close this object now, the data changes that you have made will be lost. Do you want to close the database object anyway?'
If you click 'Yes', the form closes and when you check the table the data is there and the amend date is showing correctly.
Does anybody know why it is doing this and how to get it so I can amend data and then move to the next record?
Thank you for your help.
Regards,
Robert.