Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form or Subform (2k SR2)

    I have a form that simply lists dates in the database. I want to number the records (dates) that display on this form. When I view the form in design view, I see one field in the detail section [Date]. Can I place an unbound text box to the left of this date field that will number each record that displays? If so, what kind of formula or code do I need? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Form or Subform (2k SR2)

    Doing something like this is difficult, and usually doesn't work quite right. Why are you trying to do it? Do you want to see how many there are in the list, or is it important to see that a specific date is the 10th line?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form or Subform (2k SR2)

    I use the dates when I run reports, and sometimes I would only need the 10th date. I have to count the records before choosing a date. Can you number the records in a query? If so, I could add this to the query my form is based on and then add this new field to my form. Any suggestions would be greatly appreciated. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Form or Subform (2k SR2)

    I've got to say, that's one of the strangest circumstances I've ever encountered. Actually, I don't know if there is a way to number records in a query. I believe I was getting confused with numbering records on a report. The only thing I can suggest is to activate the navigation buttons, then enter "10" in the record number field to have the 10th record highlighted. Or, you could use the TOP predicate in your query, then move to the last record.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Form or Subform (2k SR2)

    Actually, there is a way afterall. I'm assuming you are sorting your list by date (if not, adjust accordingly). Add this expression to your query:

    DCount("*", "yourtable", "somedate<=#" & somedate & "#")
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form or Subform (2k SR2)

    Thanks Mark! <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

  7. #7
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form or Subform (2k SR2)

    You could do this very easily with a report ... and then you could look at it in Preview mode and it would function just like your query.

    This is from Ken Getz/Paul Litwin/Mike Gilbert's "Access Developers Handbook:

    "To create a row counter on a report, set a text box's properties as follows -

    Set the RunningSum property to Over Group (1) or Over All (2)
    Set the ControllSource to =1

    Eh voila!
    Gwenda

Posting Permissions

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