Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    59

    Arrow Unanswered: couple of questions

    hello
    i have couple of questions
    1: i want to copy some data say for a particular date then update the date and then re-insert it into the table as new entries without modifying the original data ..i'll explain more .. i have a table which store interest rates about a bank . i entered data for one bank manually , now instead of entering each bank's data manually what i want is to copy the current data just update the bank name from the form and then re-insert it into the same table . the result should be that i should have 2 banks in my table ( this is just an example so forget about interest rates difference etc.. just a picture of what i want to do )
    and secondally

    i update my table through a query and a form .. i have this ok button which runs the query and then a message box confirming it .. but the problem is that if some how my records dont get updated i still get the message confirmation.. how to handle this ..

    plz help

    thankyou for you time

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    To answer your second question....

    Just before your VBA runs the query, insert the following line
    Code:
    DoCmd.SetWarnings True
    This will force you to confirm that you want to run the query, and it will also tell you how many records are being appended, updated, deleted, or whatever, and force you to confirm that you want SQL to actually perform the transaction.

    You can then insert code (after the query runs) to turn off warnings.
    Code:
    DoCmd.SetWarnings False
    You can thus get rid of the confirmation line you currently have.

    Sam

Posting Permissions

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