Results 1 to 7 of 7
  1. #1
    Jhalter1235 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2023
    Posts
    1

    Check Boxes


    I have a start date and end date columns. I also have a column titled Status, when its checked that means the project is complete. How do I get the end date to update to show "complete" instead of the end date when the check box is checked?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    See if the second example here helps:

    http://www.baldyweb.com/ConditionalVisibility.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    if END DATE field is a date, then you cannot show COMPLETE in it.
    but you could hide it :

    Code:
    sub chkComplete_AfterUpdate()
    txtEndDate.visible = not chkComplete
    lblComplete.visible =  chkComplete
    end sub

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Start and End dates are examples of repeating fields IMO and we all know that's not good. Consider (in addition to other relevant fields for whatever this is about)
    STATUS STATUS_DATE
    Created 01/01/2023
    Approved 1/03/23
    Fini 1/25/23
    Closed 1/31/23
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    How do I get the end date to update to show "complete" instead of the end date
    not suggesting what you want is a good thing to do but presumable it the checkbox is clicked you have code along the lines of

    if chkbox then
    enddate=date
    end if
    if so, all you need in the enddate format property is

    "Complete"

    Edit: in fact you don't need the checkbox, just put the above code in the double click event of the enddate control.
    Last edited by CJ_London; 02-01-2023 at 06:55 PM.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by Micron View Post
    Start and End dates are examples of repeating fields IMO and we all know that's not good.
    I would agree, but only in certain situations. In the scenario you laid out, a related "status updates" table would certainly be the better option. I've used that method myself. That said, sometimes there are only starts and ends, and for every start there must be an end. Two examples I've used start/end fields in are an employee timeclock app and a vehicle maintenance app for mechanics. A mechanic will clock into a given repair order to work on that vehicle. When he completes the vehicle or ends his shift, he clocks out of that repair order. I've seen this type of design for that scenario:

    Start/End Date/Time
    Start 1/1/23 9:15
    End 1/1/23 12:00
    Start 1/1/23 13:00
    End 1/1/23 16:27

    But in my view it's "over normalized". Getting elapsed time is much easier with the 2 fields, and probably more efficient than the subquery that would likely be required with 1. I think testing for end is easier as well, checking for null in the end field. With the single field field you'd have to find the last record by employee/repair order and see if it's start or end.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For clarity I should add that I would still have a related table, and in the example above it would contain 2 records instead of 4, each with start/end date/times.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 10-07-2020, 10:30 AM
  2. Replies: 5
    Last Post: 02-07-2020, 11:21 PM
  3. Replies: 5
    Last Post: 10-09-2017, 07:19 AM
  4. Check all check boxes on continuous form
    By NISMOJim in forum Forms
    Replies: 7
    Last Post: 06-14-2016, 02:14 AM
  5. Check box based on values of other check boxes?
    By Michael.Reynolds1775 in forum Forms
    Replies: 3
    Last Post: 03-25-2015, 12:58 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