Results 1 to 8 of 8
  1. #1
    MrMedic is offline Novice
    Windows 11 Office 365
    Join Date
    Dec 2022
    Posts
    2

    Want completed records to disappear and unfinished records to stay on continous form

    I'm creating a Ward Log for a Safety Database I'm creating for work. The log will help my EMTs keep track of what bed is being used, and how long they have been there. Once a patient is done, and the 'time out' field is filled, I would like to have a button that 'saves' the record and removes it from the form while keeping any other records open that aren't complete yet. The form contains fields for name, bed #, Guest/emp, Time In, Time Out, and a reason for visit. How can I go about doing this? I have attached a picture of the form. In the example, the second record is complete. I would like that record to disappear from the form, leaving record 1 and 3 on the screen. Any help would be greatly appreciated.



    Click image for larger version. 

Name:	Screenshot 2022-12-18 222955.jpg 
Views:	26 
Size:	104.1 KB 
ID:	49333

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Remove it by applying filter criteria, such as: WHERE IsNull([TimeOut]).

    Use a query with that criteria as the form's RecordSource.

    Requery the form in the Save button code.
    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
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Use a query with that criteria as the form's RecordSource.
    If the form recordsource is a query, it would be Is Null? Then you'd just requery the form rather than filter it?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Ooops, yes, should use SQL instead of VBA function.

    WHERE [TimeOut] IS NULL
    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
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    I would add a combo to the form's header to show All and Active and make the recordsource selection there (as per the previous posts); that way you can easily bring them back in case you need to review\edit them.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by Gicu View Post
    I would add a combo to the form's header to show All and Active
    Yes but might as well have the 3rd option - All, Active, Complete - or whatever is appropriate.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    MrMedic is offline Novice
    Windows 11 Office 365
    Join Date
    Dec 2022
    Posts
    2
    Thank you for the help! I got the form working how I wanted to.

    Thank you for the suggestion for the review/edit box, that's a great idea!

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    If you want to make the filter dynamic, then can't put that static criteria in RecordSource SQL.
    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. Why do records disappear?
    By dfoster in forum Queries
    Replies: 8
    Last Post: 04-18-2019, 10:53 AM
  2. Replies: 2
    Last Post: 10-26-2016, 12:44 PM
  3. Replies: 7
    Last Post: 12-03-2015, 08:37 PM
  4. Replies: 3
    Last Post: 09-13-2013, 01:45 AM
  5. Looping through records in a continous form
    By accessnihon in forum Forms
    Replies: 3
    Last Post: 01-04-2012, 01:04 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