Results 1 to 9 of 9
  1. #1
    SoniaD is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    2

    Sub Form Dates not in order of typing

    I have a subform which has a file name, date field and a comment field. Basically someone enters a date and then a comment. However, when more than one comment is entered the dates do not run in order for example I may have 09.09.15 then 10.09.15 then 15.09.15 but the last comment on the form will be 10.09.15 date. Is there a way to get the dates in order of entry? Also the comment field is a long text field and if the text is longer than the box provided it continues to accept the information but will not display all the information and you have to scroll to read everything that was entered. Is there a way to avoid having to do this. Any help would be very much appreciated. thanks


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Must apply sort criteria on the date field.

    Textboxes on form do not shrink/grow, that's why they have the scroll bar. So, answer is no. Either size the textbox to accommodate longest possible input or work with scroll bar.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    When someone updates the long text field, you can place the new comment and date at the start of the long text field. That way the latest comment will be first, and older comments will be in sequence.
    **** Untested ****
    Code:
    Longtextfield = "  "
    
    after updating with comment1
    
    longtextfield = "dateA  first comment" 
    ( I would consider a "-" before the date --could simplify parsing in future)
    (you could add a vbcrlf to get a new line in display on form)
    
    after updating with comment2
    
    longtextfield = "dateb  comment number two
                          "dateA  first comment"
    
    after updating with comment 3
    
    longtextfield = "-date x Comment number 3"
                          "-dateb  comment number two
                          "-dateA  first comment"
    
    code could be
    
    longtextfield = "-" & Date & "  " & newcomment & longtextfield & vbcrlf

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Is each comment a new record?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    In my sample -- no.
    It would use the Longtext field to record comments on a specific topic.That's how I interpreted the post. I woudn't use the long text field as a record repository. I'd have comments in a related table.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    And I was thinking individual records in my reply.

    If you are using LongText (Memo) type field and entering multiple comments in one record, consider ColumnHistory method. https://msdn.microsoft.com/en-us/lib...or=-2147217396

    It is another type of multi-value field with hidden table maintained by the app. I've never used it and don't think I ever would. I would also use a related table with date and comment in separate fields and each comment would be a new record.

    I avoid Memo fields as much as possible. They have issues.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    SoniaD is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    2
    thanks June7 I am new to access so not sure how to sort by date. We are entering multiple comments for each record depending on activity for that day so one record may have 50 or so comments

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Sonia,

    Before getting too deep into the nitty-gritty of Access, you should do some research (reading/tutorials etc) of database concepts and design.

    Here are a few sites that may be useful:
    http://www.ucl.ac.uk/archaeology/cis...ual/node1.html
    Post 3 at https://www.accessforums.net/access/...les-43061.html

    And for Access
    https://www.youtube.com/playlist?lis...03jQ_t9nFV737s

    Good luck.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Well, can't sort by date with that structure. As noted, I would not do that.

    Why would the comments not be displayed in the date order? Why would a comment dated 15.09.15 be entered before 10.09.15?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-21-2014, 06:37 PM
  2. Replies: 12
    Last Post: 04-16-2014, 07:26 AM
  3. Need Help Putting Dates in Order...
    By dgaletar in forum Forms
    Replies: 2
    Last Post: 02-11-2014, 09:45 PM
  4. Typing SQL statements in VBA
    By dylcon in forum Programming
    Replies: 13
    Last Post: 06-11-2013, 09:21 AM
  5. Replies: 1
    Last Post: 11-21-2010, 02:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums