Results 1 to 3 of 3

Thread: plz help

  1. #1
    Join Date
    Mar 2004
    Posts
    3

    Unanswered: plz help

    I havnt used access in 2 years and i get a job that calls for one, great. So here's my problem, Im trying to Append data from field a. to field b. in the same table. But the data from field a. has to be from the previous date/ID and i cant get it to work, My brain draws a complete blank when i try to figure it out

    Thx,
    MindJelly

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    a recordset seems the easiest solution

    in DAO-speak:

    dim dabs as dao.database
    dim recs as dao.recordset
    dim aVar as xxxxxx 'whatever suits your field
    set dabs = currentdb
    set recs = dabs.openrecordset("nameOfYourTableInQuotes")
    with recs
    aVar = yyyyyyyyyyy 'whatever fieldB should be in record 1
    do while not .eof
    .edit
    !fieldB = aVar
    .update
    aVar = !fieldA
    .movenext
    loop
    end with
    set recs = nothing
    set dabs = nothing
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    and probably safer

    dim strSQL as string


    strSQL = "SELECT * from YourTable ORDER BY theNameOfTheIDfield;"
    set recs = dabs.openrecordset(strSQL)



    izy


    LATER
    or better:
    strSQL = "SELECT fieldA, fieldB FROM YourTable ORDER BY theNameOfTheIDfield;"
    Last edited by izyrider; 03-21-04 at 04:07.
    currently using SS 2008R2

Posting Permissions

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