Results 1 to 2 of 2

Thread: insert question

  1. #1
    Join Date
    Oct 2003
    santa clara

    Unanswered: insert question

    I have a query and a form. From the form a user enters a number and then hits a button. From there I'm trying to insert new records into a table. The new table takes the information from the query as well as the number from the form. Each time a new record is added I have to add 1 to the number. What's the best way to achieve this.

  2. #2
    Join Date
    Dec 2001
    You could use an SQL Insert statement in the OnClick event procedure of your button. Ex.:

    DoCmd.RunSQL "Insert ..."

    See Access help for details about the SQL Insert statement.

    If you have a field in a table that you want to increment each time a record is inserted, you may want to use an autonumber field.

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers

Posting Permissions

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