• Form or Subform (2k SR2)

    Author
    Topic
    #360690

    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? confused

    Viewing 1 reply thread
    Author
    Replies
    • #543700

      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?

      • #543701

        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. scratch

        • #543710

          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.

        • #543712

          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 & "#")

    • #543746

      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

    Viewing 1 reply thread
    Reply To: Form or Subform (2k SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: