Results 1 to 3 of 3
  1. #1
    mschmucker is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6

    Default value in a form

    I am using Access 2003. I have a database with a field "Shipper#" that I want the default value to 1 larger than the previous record. I also want to be able to override the number, sometime we will have 5 lines with the same shipper#, most rows will have a different shipper#. I have tried the following: Max("[shipper#]","tblschedule")+1 and I have tried:



    Private Sub Form_BeforeUpdate(Cancel As Integer)
    If IsNull(MySeqNo) Then
    MySeqNo = DMax("Shipper#", "tblSchedule") + 1
    End If
    End Sub

    What I get is 2 records with the same shipper# and then the third record increases by 1.

    Any ideas one why every row does not increase in shipper#?

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Code looks good. Do you want to provide project for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Default value from another form
    By hitesh_asrani_j in forum Forms
    Replies: 12
    Last Post: 10-13-2011, 10:14 AM
  2. Default Form Size
    By plevine1 in forum Forms
    Replies: 2
    Last Post: 09-24-2011, 07:14 PM
  3. Default form layout when creating new form
    By MDB in forum Programming
    Replies: 1
    Last Post: 08-30-2011, 08:17 AM
  4. Default Values in a form
    By handjor in forum Forms
    Replies: 3
    Last Post: 08-03-2011, 09:11 AM
  5. How to set default form
    By LAazsx in forum Forms
    Replies: 4
    Last Post: 11-28-2010, 12:22 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