Results 1 to 10 of 10
  1. #1
    New Lounger
    Join Date
    Feb 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Incrementing Job Card Serial Numbers (Access 2002)

    Just after a little help with setting up a basic database, what I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    >> I need the ability to move the location of where the numbers are being printed on the sheets.

    Do you mean that
    (1) you, as designer, must be able to specify this once, for all numbers and for all time, or
    (2) the user can specify it once per "run", for all numbers, or
    (3) the individual numbers can be moved around independent of each other.

  3. #3
    New Lounger
    Join Date
    Feb 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    Thanks for the reply Hans,
    No. (2) applies ie the user would enter a range to print like "Start Range" 2000 "End Range" 2500.
    I envisage this would be entered on a basic form
    Then a print Icon on the form would allow me to print out a sequential series of the above entered serial number starting at 2000, then incrementing 2001,2002,2003 etc with one serial number per job card, I need to be able to adjust the location of where the serial number is printing on each job card in case the dimensions of the cardboard job cards change in the future, I also have other standard information I intend to add to the job card that doesnt change ie headers footers etc
    Regards
    Ian

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    I think you will have to put the serial numbers in a table temporarily, and use this table as record source of a report. This means that the report cannot be run by two users simultaneously. When the design of the card changes, you would have to change the design of the report.

    1. Create a table tblTemp with one field SeqNum, type Number (Long Integer) that is also the primary key.

    2. Create a report rptSeqNum. Set its record source to tblTemp, and place one text box bound to SeqNum in the detail section. Set the Force New Page property of the detail section to Before Section.

    3. Create a form with text boxes txtStart and txtEnd, and a command button cmdOK. The On Click event of the command button, populate the table and open the report. The essential part is

    ' Delete records from table
    strSQL = "DELETE FROM tblTemp"
    CurrentDb.Execute strSQL, dbFailOnError

    ' Fill table
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("tblTemp")
    For i = Me.txtStart To Me.txtEnd
    rst.AddNew
    rst!SeqNum = i
    rst.Update
    Next i

    ' Open report
    DoCmd.OpenReport "rptSeqNum", acViewPreview

    See attached demo for complete code. Note: the code uses DAO, so you must set a reference to the Microsoft DAO 3.6 Object Library in Tools | References...
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Feb 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    Thanks Hans that works well
    Regards
    Ian

  6. #6
    New Lounger
    Join Date
    Feb 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    Hans,
    In the report how would I get the serial number to print not only on the front of the paper job card, but the back as well on a duplex printer?
    Any help would be greatly appreciated.
    Regards
    Ian

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    == This means that the report cannot be run by two users simultaneously. ==

    Hans,

    How about putting a user table in the front end that way you need not worry about multiple users?
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    If your printer prints both sides of each page before continuing to the next page, you could duplicate the lines

    rst.AddNew
    rst!SeqNum = i
    rst.Update

    so that each number occurs twice. This requires that SeqNum is not the primary key any more. It would also be possible to write code to make the report print each page twice.

  9. #9
    New Lounger
    Join Date
    Feb 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    Thanks Hans, I'm guessing that I add in the code that you mentioned behind the "OK" button?
    How would I not make the SeqNum not the primary key anymore?
    Im a little bit lost with how to do the above? Any chance you could zip the file like you did before?
    Regards
    Ian

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Incrementing Job Card Serial Numbers (Access 2002)

    Ian,

    You should be able to do this yourself without problems, but here goes. Since I don't know how your duplex printer works, I can't guarantee that it will do what you want.
    Attached Files Attached Files

Posting Permissions

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