Hi folks,
.
Welcome back derek, and thanks for chiming in on this. No, I haven't moved on as I'm still weighing out the different options and how to approach it.
brian
Thanks for your last suggestions. I was able to get it working in a different project, so I'm pretty sure it's a timing issue with when the format is being applied in the project with the error.
.
I do have another question now though... but let me add an extra detail to this:
.
There will always be a date, but the time is optional. I noticed in the default tableGrid formatting of the DateTime field that when the time is midnight 00:00:00, it doesn't even display the time (and I prefer this). However, when that grid format is applied, the time 00:00 is always displayed. Is there a way to ignore the time when it's midnight like in the default?
.
In my attached example, I am using a button instead of the OnChange event to demonstrate my question above.
derek
I have a few questions about your project, if you will.
.
1. Also in my attached example, I used your approach without the event.cfmonth but instead event.eDate. Do you see where this could cause a problem? Is the cfmonth necessary?
.
2. In your example, you use copy(frmmain.dtpfilter.sqldate,2,7). I was trying to figure out why you start with 2. I tested 0 and 1, and in both cases it included the first double quote ". Are 0 and 1 returning the same thing in this case? Would you explain this further, please?
.
Also thanks for the suggestion for leaving the checkbox on the filter date. I hadn't thought about that.
general questions
1.
It's not necessary to deal with seconds or mseconds with the time field. On the frmDetail when I use format HH:mm, it indeed hides the seconds and the AM/PM, but it's still recording the seconds and possibly the mseconds. I need those to always be 00 in any case. That way- if there is a way to do the formatting described above, the time will be hidden in the tableGrid.
.
2.
Because the time is optional, on the frmDetail the dtpTime is linked to the dtpDate, so when the Time is unchecked the date is also not saved. I have some ideas on how keep the time excluded (maybe by using other hidden controls and scripts). Is there a better way of doing this?
.
This is the issue I was having in my last post where I was talking about using two separate fields again. I don't particularly like this idea. So I'm still experimenting for now.
[edit] forgot to add the project [/edit]
"Energy and persistence conquer all things."