Help.Chris
Registered User.
- Local time
- Today, 20:53
- Joined
- Oct 11, 2000
- Messages
- 43
Hi all,
Thanks in advance for any help.
I have a subform which contains the following details,
NumberId, Valid_From, Valid_To, In_Use
When the use changes the in_use item (yes/no) i want to write the current record to the table with the Valid from_from date entered.
Then i want to create a new record with the Valid-to set to current date. hence getting a history of changes to the record.
This i can achieve using
DoCmd.RunSQL "UPDATE Number_Details SET Number_Details.Valid_To = dateadd('d',-1,Date()) WHERE (((Number_Details.NumberDetails_Id)=" & Me.NumberDetails_Id & "))"
DoCmd.RunSQL "INSERT INTO Number_Details ( Number_Id, Valid_From, In_Use, CampaignDetails_Id ) SELECT " & Me.Number_Id & ", Date(), " & Me.In_Use & ", " & Me.CampaignDetails_Id
This works but comes up with a write conflict message, i am guessing due the fact the record is still showing in the form.
Is there a way of getting round this message
Thanks all
Chris
Thanks in advance for any help.
I have a subform which contains the following details,
NumberId, Valid_From, Valid_To, In_Use
When the use changes the in_use item (yes/no) i want to write the current record to the table with the Valid from_from date entered.
Then i want to create a new record with the Valid-to set to current date. hence getting a history of changes to the record.
This i can achieve using
DoCmd.RunSQL "UPDATE Number_Details SET Number_Details.Valid_To = dateadd('d',-1,Date()) WHERE (((Number_Details.NumberDetails_Id)=" & Me.NumberDetails_Id & "))"
DoCmd.RunSQL "INSERT INTO Number_Details ( Number_Id, Valid_From, In_Use, CampaignDetails_Id ) SELECT " & Me.Number_Id & ", Date(), " & Me.In_Use & ", " & Me.CampaignDetails_Id
This works but comes up with a write conflict message, i am guessing due the fact the record is still showing in the form.
Is there a way of getting round this message
Thanks all
Chris