Results 1 to 10 of 10
  1. #1
    barkly is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    23

    Auto Line Number Continuous form

    Seek help please. How do I put auto generated line numbers on a continuous form?



    I note this very simple method for Reports -

    Control Source =1
    Running Sum Over All

    I cannot find anything like this for a form ie what detail to I put in the designated TextBox.

    Thanks

    barkly



  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Unbound controls do not play well with continuous forms. The title of your thread suggests you want the record number. THis would need an unbound control displayed in each record and it will not disp[lay information correctly.

    You can access the record number property something like this.

    Dim lngAbsoulute As Long
    lngAbsoulute = Me.Recordset.AbsolutePosition

    If you want to do a sum calculation like your code suggests, you might try an unbound control in a header or footer.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Review

    http://www.lebans.com/rownumber.htm

    http://allenbrowne.com/ranking.html

    But really, what purpose does this serve?
    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.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    There you go, have it available in the recordset via the query.

  5. #5
    barkly is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    23
    Thanks all for your interest and responses. You will see from the Allen Browne version that is where got the method for a Report - unsuitable for a form of course.
    I shall look at each of the suggestions but i think I am now leaning to perform a simple count process back at the query behind the form and let the form take the values.

  6. #6
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Hello
    So after my instructors
    Try this code
    Put a text box on the form (intBCUIRNum)
    Put this code in when loading
    If Me.NewRecord Then
    On Error Resume Next 'It should never occur, just to be sure...
    Me!intBCUIRNum.DefaultValue = Nz(DMax("[intBCUIRNum]", "tblName"), 0) + 1
    End If

  7. #7
    barkly is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    23
    Thanks Competent Performer,

    I do not understand this part Nz(DMax("[intBCUIRNum]", "tblName"), 0) in particular tblname. My form derives its data from a query and within this query I do not have any reference to intBCUIRNum.

    I should advise I am at the hacker end of the spectrum when it comes to Access - I have to plug away at it.

    Thanks for your interest

  8. #8
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Hi barkiy
    Must be (intBCUIRNum) field within the table
    And then summoned to the query
    Click image for larger version. 

Name:	22.JPG 
Views:	10 
Size:	27.0 KB 
ID:	15418

  9. #9
    barkly is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    23
    Apologies azhar2006 ( yes I do agree a-Competent Performer),

    Yes I have it now as you advised but still no number display unfortunately.

    I presume by your previous statement
    Put this code in when loading
    you mean at the Form an Event Procedure under 'On Load'.

    This is what I have but as I say -no numbers.

    Thanks again

    barkly

  10. #10
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    See The DB
    Attached Files Attached Files

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

Similar Threads

  1. Auto Populate a text box in a continuous form
    By KevinCollins in forum Access
    Replies: 6
    Last Post: 10-28-2013, 08:04 AM
  2. Replies: 11
    Last Post: 01-25-2013, 12:03 PM
  3. Auto Count Month in Continuous Form
    By Mpike926 in forum Forms
    Replies: 10
    Last Post: 05-18-2012, 11:18 AM
  4. how to get auto numbering on continuous form records
    By shubhamgandhi in forum Programming
    Replies: 1
    Last Post: 08-04-2011, 02:26 PM
  5. Replies: 5
    Last Post: 05-02-2011, 11:02 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