Results 1 to 3 of 3

Thread: Access- -Copy values

  1. #1

    Thread Starter
    Member dmerchen's Avatar
    Join Date
    Mar 2001
    Location
    Moving Back to Texas
    Posts
    60

    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.
    DMerchen

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    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

    BOFH Now, BOFH Past, Information on duplicates

    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...

  3. #3

    Thread Starter
    Member dmerchen's Avatar
    Join Date
    Mar 2001
    Location
    Moving Back to Texas
    Posts
    60

    Thanks...

    Got it just this morning. Thanks again.
    DMerchen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width