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?
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?
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
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.
not suggesting what you want is a good thing to do but presumable it the checkbox is clicked you have code along the lines ofHow do I get the end date to update to show "complete" instead of the end date
if so, all you need in the enddate format property isif chkbox then
enddate=date
end if
"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.
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.
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.