Append records from form

New2VB

Registered User.
Local time
Today, 07:04
Joined
Jun 9, 2010
Messages
131
Greetings Gurus,

I'm not quite sure how to put this (or if it is even possible) but I'm sure one of you will be able to tell me.

I am entering records through a form (as you would :)), closing the form and the record displays in the table.

What I would like to do is be able to modify that record on the form and on clicking a command button, if the record has changed, append it to the table instead of overwrite it thus keeping the old record in the table as well

I imagine (very broadly) that the code would look something like...

IF Me.something.Value is not null AND Me.something.Value <> Me.something.Oldvalue THEN Dim db As Database, tb As DAO.Recordset
Set db = CurrentDb
Set tb = db.OpenRecordset("SomethingTable", dbOpenDynaset, dbSeeChanges)
tb.AddNew
tb!Something = [Forms]![SomethingForm]![SomethingSubForm].[Form].Something
tb.Update
tb.Close
End If

please stop laughing now, I'm still trying to figure this lot out.

Much gratitude if you can help.
 
Greetings Gurus,

I'm not quite sure how to put this (or if it is even possible) but I'm sure one of you will be able to tell me.

I am entering records through a form (as you would :)), closing the form and the record displays in the table.

What I would like to do is be able to modify that record on the form and on clicking a command button, if the record has changed, append it to the table instead of overwrite it thus keeping the old record in the table as well

I imagine (very broadly) that the code would look something like...

IF Me.something.Value is not null AND Me.something.Value <> Me.something.Oldvalue THEN Dim db As Database, tb As DAO.Recordset
Set db = CurrentDb
Set tb = db.OpenRecordset("SomethingTable", dbOpenDynaset, dbSeeChanges)
tb.AddNew
tb!Something = [Forms]![SomethingForm]![SomethingSubForm].[Form].Something
tb.Update
tb.Close
End If

please stop laughing now, I'm still trying to figure this lot out.

Much gratitude if you can help.


Not laughing, but use an append query to another table via the command button based on the criteria of the form fields.
 
Hi Trevor,

Apologies in delaying the response.

It was not quite what I was looking for but gave me an idea of writing the records to a 2nd table using code so thanks very much.
 

Users who are viewing this thread

Back
Top Bottom