Results 1 to 2 of 2
  1. #1
    Barbara is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    1

    Question How do I write a macro to automatically fill in the next number in a sequence


    I have a database with existing information and need to create and want to add a new number in an existing sequence when and new Purchase Order Number is added. I know I need a macro but I do not know how to write it. Can someone please help? Thanks so much.....

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You could set the Default Value property of the textbox to
    =DMax("YourPurchOrdNumField","YourPurchOrdTableName")+1
    I think this would work for a single user app, but you could have problems in a split db with multiple front ends.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Enter new number in sequence in PO
    By tchirpich in forum Access
    Replies: 30
    Last Post: 12-30-2011, 11:24 AM
  2. Replies: 2
    Last Post: 11-21-2011, 10:48 AM
  3. how to auto inset sequence number at column
    By newaccess in forum Access
    Replies: 1
    Last Post: 04-01-2011, 06:55 PM
  4. Find Missing Number in Sequence per Record
    By escuro19 in forum Programming
    Replies: 1
    Last Post: 11-10-2009, 03:15 PM
  5. Auto Sequence String Serial Number
    By eddyc99 in forum Programming
    Replies: 2
    Last Post: 10-02-2009, 08:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums