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

    Displaying record #

    How do I display the current record number in a text box on a MS Access 2003 form?

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

    Re: Displaying record #

    Welcome to Woody's Lounge!

    If you display the navigation buttons at the bottom of the form, you already have the record number. Otherwise, use a text box with the following as Control Source:

    =[CurrentRecord]

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Displaying record #

    Hans,
    This is the first time I see this. Is =[CurrentRecord] a built in expression or is it being pulled from a method in VBA like Frm.CurrentRecord?
    Tx
    Regards,
    Rudi

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

    Re: Displaying record #

    What is "a built in expression"? You probably mean a VBA expression by that.

    CurrentRecord is a VBA property of the Form object. If you use it in the record source of a text box without further qualification, it refers to the form containing the text box.

  5. #5
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Displaying record #

    Wow...I did not realise this could be done.

    It seems that the values of most properties of the current form can be called up by using this. For instance =[DatasheetFontName] and =[Modal] give details about the form state in the text box...
    Its almost like the CELL() and INFO() functions in Excel.

    Tx for the tip!
    Regards,
    Rudi

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

    Re: Displaying record #

    Yes, you can use VBA properties in expressions, for what it's worth. You can use

    =[Filter]

    to display the currently active filter, or

    =[txtSomething].[Width]

    to see the width of text box txtSomething (in twips, 1 inch = 1440 twips)

Posting Permissions

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