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

    forms repeating dates Another approach (97/SR2)

    Let me try another approach to my earlier post:
    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 ...

    I can't eliminate the dates in each file. Is there a way to have a line appear on the form after that last file for each given date.
    Like this:
    3/5/03 file
    3/5/03 file
    ______________

    3/6/03 file
    3/6/03 file

    At least then the page would be easier to read. Thanks for ideas.

  2. #2
    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 Another approach (97/SR2)

    Although you haven't said so explicitly, it appears that your form is set up for "continuous forms" as your default view. This being the case, you're always going to have problems modifying the appearance of your form based on the values of the underlying data (e.g., not displaying a date or adding a line separator if the date has changed from the previous record). This is because the appearance of a given control (e.g., the date control) can appear only one way even though it can appears many times (for the Continuous Forms view). For example, if the current record's data dictates that the control should be made invisible, then it's going to appear invisible for all of the records shown in the Continuous Forms view, regardless of it value for other records. Hence, you're more or less stuck unless you switch to Single Form view, but then you don't get the list you're looking for.

    The only workaround for this that I've figured out is to massage your data (as I described in <post#=254419>post 254419</post#>) to include a "to be displayed as" field.

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: forms repeating dates Another approach (97/SR2)

    Why not try creating a report with the same recordset of the form and then use the sorting and grouping feature on the report grouped on Date?
    Regards,

    Gary
    (It's been a while!)

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: forms repeating dates Another approach (97/SR2)

    One other approach. If your data is set in two tables as a one to many relationship then create a mainform with a subform. Link the parent and child on the linked fields between the form. Set the main form with the date data. The subform with the file data. Then when you scroll through the date data (one record) the subform will show all associated files.

    HTH
    Regards,

    Gary
    (It's been a while!)

  5. #5
    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 Another approach (97/SR2)

    Paul wants the results on a form Gary... A continuous form... I suggested the Main form (single)/ Subform (continuous) thing earlier today.... GMTA!
    I ran out of ideas... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: forms repeating dates Another approach (97/SR2)

    GMTA??

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

    Re: forms repeating dates Another approach (97/SR2)

    Great Minds Think Alike

    or take your pick:

    Georgia Motor Trucking Association
    Greenfield Montague Transportation Area
    Guam Mass Transit Authority
    Genetically Modified Total Annihilation
    Greater Madison Tennis Association

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: forms repeating dates Another approach (97/SR2)

    You have a great imagination. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  9. #9
    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 Another approach (97/SR2)

    Geezzzz... Hans knows it ALL! <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

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

    Re: forms repeating dates Another approach (97/SR2)

    No, I have a great Google <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

  11. #11
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Maidstone, Kent, England
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: forms repeating dates Another approach (97/SR2)

    Building on Toms approach you could use a custom function in the query behind the form to create a new column which just shows the dates once and display this column in the Form. The code for the module would be something like,

    Function CheckDate(dDate As Date) As Variant
    Static lastDate As Date
    If dDate <> lastDate Then CheckDate = dDate
    lastDate = dDate
    End Function


    In the Query you would use "ShowDate: checkdate([Mydate])" in a new column to create the new field for your form.

    However with this approach if anyone sorts the data in the form you are going to get some screwy results!!

    HTH

    Peter

  12. #12
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Module vs Routine

    Just a minor quibble. The code is for a routine or function, not a module. A module is a container that holds code, not the routines themselves. I know you are aware of the differences, but I wanted to make it clear for those who are new to VBA in Access.
    Charlotte

  13. #13
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Maidstone, Kent, England
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Module vs Routine

    Not a very nice piece of code either LOL

    Peter

  14. #14
    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 Another approach (97/SR2)

    Or one of my favorites: Great Minds Think Alike... And So Do Ours!!

Posting Permissions

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