|
-
Jun 28th, 2004, 02:33 PM
#1
Thread Starter
Member
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.
-
Jun 30th, 2004, 03:57 AM
#2
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
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 30th, 2004, 10:46 AM
#3
Thread Starter
Member
Thanks...
Got it just this morning. Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|