Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    forms-repeating dates (97/SR2)

    I have a form that lists files according to dates. Is there a way to stop the form from repeating the same date over and over again. I want the date shown once, then all the files for that date. Then next date ... Easy to do on a report. How do you do it on a form?

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: forms-repeating dates (97/SR2)

    I don't know if this is the answer for you... but personally I'd use a subform control...
    For example: The main form would be in Single Form view with the Date control in the Detail section.... Then I would place a subform control into the detail section... The subform would be in Continuous Forms view, showing the file data, linked on the Date field...

    Does that help at all??

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: forms-repeating dates (97/SR2)

    That won't work because you can not have a continuous form that contains a subform. I want the form to show several dates with related files under each date just like a report.
    Thanks for the idea.

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

    Re: forms-repeating dates (97/SR2)

    You're not going to like this, but I think you should reconsider your setup. Forms and reports have different purposes. Bound forms are for enterig. editing and viewing data. Each record must be complete. Reports are for presenting and summarizing data. In a report it makes sense to hide repeating data, in a form it doesn't. By trying to make a form look like a report, you are trying to make it do something it wasn't designed for.

  5. #5
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: forms-repeating dates (97/SR2)

    Could a Treeview control do what you want?
    I've never used one myself but there are several threads in the Lounge about them.

    Just a thought. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  6. #6
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: forms-repeating dates (97/SR2)

    Paul,

    I agree with Hans 100%. However, if you HAVE to have this information on a form (rather than a report), one way to get what you want would be to create a temporary table (using a Make Table query) cloning your source table (list of file names and dates) with an added "dteNewDate" Date/Time field and with the records ordered the way you want them to appear in the form. Then use VBA code to scan through this table's records (or through the results of an updatable query that orders the records the way you want them) and assign the Date field's value to dteNewDate field if and only if the previous record's date is different. Use this temporary table as your recordset for the form and dteNewDate as the Control Source for your date control. Of course, if you are using this form to update the table you'll need to get the updated data back into your original table (in which case it might be a better strategy to create a related (one-to-one) table that provides the dteNewDate for records where the date has changed, null otherwise).

    This, to me, is a bit cumbersome but if you need to use a form in a way it was not intended (as Hans has indicated), I guess you gotta pay the price.

    Maybe there's an easier way... Quoting Ben Stein: Anyone? ...Anyone?

    Good luck.

  7. #7
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: forms-repeating dates (97/SR2)

    Thanks to everyone for replying. I also agree with what Hans said. I was just trying to give the teacher what he wanted. I'll just tell him he can't always have what he wants. That should go over well.

Posting Permissions

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