Transfer row from 1 table to another
Hi,
Not sure where i should post this, but this is what i'm trying to do,
0) I have a form which is based on tbl1. On the form, there is this textbox txtA. The form can be saved by clicking a button, without keying in txtA.
1) However if txtA is keyed with legit data( date type which is => current date) in it when the form is saved,
2) it would auto populate txtB and txtC. txtB is dmax + 1 from a dlookup of a field in another table tbl2. and followed by appending the year(2 digits) to the left of txtB and store this appended data into txtC.
3) Next it would copy this entire record from tbl1 and dump it into a new record on tbl2.
4) the entire record which was previously copied from tbl1 will then be deleted.
If txtA does not have data in part 1, part 2-4 wouldnt occur.
Questions - I've already done up to part 1 now but i'm not too sure how to continue hence i would like some suggestions if its possible to do this or better ways to do this?
Q1 - the check for legit data in txtA would be in the before update event of the form?
Q2 - This should occur also in the beforeupdate event of the form right after part 1?
Q3 - No idea how and when to do this, should this step be carried out in the afterupdate event of the form? and is there a row copy function?
Q4 - No idea how and when to do this part too. is there some vba for this "cut" function? Which event do i use to perform this step?
Questions numbers here corresponds to the parts above.
Hi,
Not sure where i should post this, but this is what i'm trying to do,
0) I have a form which is based on tbl1. On the form, there is this textbox txtA. The form can be saved by clicking a button, without keying in txtA.
1) However if txtA is keyed with legit data( date type which is => current date) in it when the form is saved,
2) it would auto populate txtB and txtC. txtB is dmax + 1 from a dlookup of a field in another table tbl2. and followed by appending the year(2 digits) to the left of txtB and store this appended data into txtC.
3) Next it would copy this entire record from tbl1 and dump it into a new record on tbl2.
4) the entire record which was previously copied from tbl1 will then be deleted.
If txtA does not have data in part 1, part 2-4 wouldnt occur.
Questions - I've already done up to part 1 now but i'm not too sure how to continue hence i would like some suggestions if its possible to do this or better ways to do this?
Q1 - the check for legit data in txtA would be in the before update event of the form?
Q2 - This should occur also in the beforeupdate event of the form right after part 1?
Q3 - No idea how and when to do this, should this step be carried out in the afterupdate event of the form? and is there a row copy function?
Q4 - No idea how and when to do this part too. is there some vba for this "cut" function? Which event do i use to perform this step?
Questions numbers here corresponds to the parts above.
Last edited: