Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Unanswered: Archive records to new database using information from form.

    Hi,

    can someone help me?

    I'm trying to archive records from two tables into a new database based on the following.

    tblreview, datecomplaint is not null
    and tbl case, date added is less than or equal to the value of a textbox on the form I'm trying to run it from.

    I know it's something to do with a make table query etc. but other than that I'm stuck.

    Attached is the basic database including the tables & form, and the table structures.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2004
    Location
    Romania - Bucharest
    Posts
    50

    Re: Archive records to new database using information from form.

    Had not enough time to look into your attachement, but:

    a) Link into your source database (containing the tables to be archieved) the destination tables (where your rows will go)

    b) create your select for the rows to be archieved

    c) using your select from b) create and INSERT sql into the destination table

    d) using the WHERE clauses from your select at b), delete the archieved rows from your source tables.

    See also if you can include c) and d) in a transaction

    Originally posted by bertthefreak
    Hi,

    can someone help me?

    I'm trying to archive records from two tables into a new database based on the following.

    tblreview, datecomplaint is not null
    and tbl case, date added is less than or equal to the value of a textbox on the form I'm trying to run it from.

    I know it's something to do with a make table query etc. but other than that I'm stuck.

    Attached is the basic database including the tables & form, and the table structures.

  3. #3
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Re: Archive records to new database using information from form.

    sorry I've tried some of that and can't get it to work right, it keeps saying the destination database does not exist.

  4. #4
    Join Date
    Jan 2004
    Location
    Romania - Bucharest
    Posts
    50

    Re: Archive records to new database using information from form.

    Sorry, I didn't notice that your destination database doesn't exist. So... I think you should write a little piece of code, first to create your destination database, using the CreateDatabase method, then to create the destination table in your destination database, using the CreateTableDef method, then you can proceed with your archieving.

    See the Access Help for details on the two methods

  5. #5
    Join Date
    Jan 2004
    Posts
    16

    Re: Archive records to new database using information from form.

    try this
    Attached Files Attached Files

  6. #6
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87
    hi biskra,

    that look ideal although I want to be able to create a new table each time without overwriting previous data any suggestions?

Posting Permissions

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