I have a 2 tables, tblA and tblB and a form bound to tblA. On clicking a button, cmdAppend all records in tblA are “copied and pasted” to tblB. However when I click the button a second time the whole records from tblA is again copied to tblB. I only wanted a NEW record in tblA to be appended to tblB without deleting all records (in tblB) and appending all records from tblA to tblB. Is this possible?
Fields in tblA Type
Fields in tblB Type
Private Sub cmdAppend()
On Error GoTo Err_cmdAppend
MsgBox Err.Number & " " & Err.Description
INSERT INTO tblB( Geog, English, Maths )
SELECT tblA.Geog, tblA.English, [Maths]*1.2 AS EMaths
What you are asking here, if you click the button twice it appends tblA to tblB twice? Yes it will
unless you either empty/delete the data from that table or enter some criteria to identify which are new Recordset.
yes if I were to click twice I get all the records from tblA appending to tblB twice. What I wanted is when a new record is added to tblA I only want the new record to append to tblB, not the entire tblA's records. Probably I need is some codes which I am not sure how to do. Thank for your reply.
there is a flag in MSaccess call NewRecord has true/false value
also there is a me.dirty
whether the current record has been modified since it was last saved.
I use both of these heaps of times
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.