-
Access- -Copy values
I would like to copy values I have in text boxes, generate an new record and then paste those same values into the text boxes on the new record. Is this possible? I am trying to come up with an easy way to automatically fill in the values. I have a piece of equipment scheduled for work, I complete the work, but then I am ready to schedule it again. Rather than go back and forth with the numbers to fill in, there are a few numbers that remain the same and I would like to hit a button and have them fill in automatically on the new record. Any help is appreciated.
-
You could use an INSERT INTO sql statement, built up via code in a string and executed.
ie
Code:
strsql="INSERT INTO tablename ( field1,field2,field3,field4 ) "
strsql=strsql & "SELECT [" & txtBox01.text & "] as field1 "
strsql=strsql & ", [" & txtBox02.text & "] as field2 "
strsql=strsql & ", [" & txtBox03.text & "] as field3 "
strsql=strsql & ", [" & txtBox04.text & "] as field4 "
Or something like that. When executed adds one newline of data the same.
Alternatively store all values into an array. Add a new record and replace values into the textboxes of the new record.
Vince
-
Thanks...
Got it just this morning. Thanks again.