pinkdatabase
Registered User.
- Local time
- Today, 23:22
- Joined
- Jun 14, 2010
- Messages
- 13
I am trying to set up a system where by when a user wants to delete a record it is not deleted as such but flagged as deleted by recording -1 in the table's IsDeleted field. I do not want important information to be totally lost to the database
To do this I have IsDeleted Yes/No in every important table in the application.
When a user hits the delete button in any form I want to call a routine that says check out the name of the current form and update the IsDeleted field to -1.
I thought is should look like this
Public Sub DeleteIt()
Dim strCurrentName As String
strCurrentName = Application.CurrentObjectName
Forms!strCurrentName!IsDeleted = -1
End Sub
but Forms!strCurrentName!IsDeleted doesn't work. Access does not recognize strCurrentName as a Form.
I could put this code in all of the forms but I was hoping to do better than that.
QUESTIONS: How would I do what I am trying above?
What other way can I achieve this type of process of virtual deletion?
Thanks in advance
Greg
To do this I have IsDeleted Yes/No in every important table in the application.
When a user hits the delete button in any form I want to call a routine that says check out the name of the current form and update the IsDeleted field to -1.
I thought is should look like this
Public Sub DeleteIt()
Dim strCurrentName As String
strCurrentName = Application.CurrentObjectName
Forms!strCurrentName!IsDeleted = -1
End Sub
but Forms!strCurrentName!IsDeleted doesn't work. Access does not recognize strCurrentName as a Form.
I could put this code in all of the forms but I was hoping to do better than that.
QUESTIONS: How would I do what I am trying above?
What other way can I achieve this type of process of virtual deletion?
Thanks in advance
Greg