Results 1 to 8 of 8

Thread: Auto Records

  1. #1
    Join Date
    May 2009
    Posts
    5

    Unanswered: Auto Records

    Hello, I am using Ms Access 2003. I have a table with 4 fields
    RecId (AutoNumber), FirstChq (Number), LastChq (Number), ChqRunDate (date). I want to creat auto records in another table with two fields ChqNum and Dated for each cheque number. Example if FirstChq =50 and LastChq =55, instert 50, 51, 52, 53, 54 and 55 as ChqNum. Is it possible? Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Yes. You should create a numbers table (read up on these on the internet).
    Code:
    INSERT INTO destination (theNumber)
    SELECT n.theNumber
    FROM theTable 
    INNER JOIN
    numbers as n
    ON n.theNumber BETWEEN FirstChq AND LastChq
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    BTW - are you later on editing the rows in this second table? Are you adding any data other than the numbers and dates?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    May 2009
    Posts
    5
    Yes I need to append new records when issuing new cheques

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Sorry, that wasn't an answer to my question. I know you want to append new records. I am asking:
    Do you record any other data other than number and date in your new table?
    Do you ever edit the dates or numbers of data in this table?

    There is a reason for asking this.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    May 2009
    Posts
    5
    Sorry, Just one other field stating if the cheque is cancelled. No I don't edit the data

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Aha! That's fine then. In that case, my code in post #2 applies.

    Just so you know, if you were not storing information specific to individual cheques then I would have said that you should dispense with your table and generate the information at run time using SQL (i.e. not store the individual numbers, just display them when needed).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    May 2009
    Posts
    5
    Thank you for your help.

Posting Permissions

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