views:

98

answers:

2

Hi everyone,

I just have a quick question. I am maintaining an app for my summer co-op position, and a new requirement came down today where the user requested to have a date control added to a form to mark the date of when an employee is "laid off". This control is enabled/disabled by a toggle button, and has its control source bound to a field that I added in the database. All the functionality has been added and tested, but....

The issue I am having is that the date picker is on a tab control (the 2nd page) and I am having problems trying to get the control to display the date that is stored in the field I created. I know the control is storing any changes made using it, but since the user asked to move the control over to the 2nd tab (it was on the first), it just shows today's date, not the date entered using the control. To make things a little more strange, if I place the control anywhere except the tab control, it seems to be working fine. I've even placed a textbox on the tab and set its control source to the database field, and it displays just fine. What gives?

And I have registered the .ocx with Access, and as I mentioned before, the actual database is storing the data. Just not displaying it. Any ideas as to what I am doing wrong?

A: 

Drop that clunky MS data picker control... Try this completely MS Access native date picker: http://www.glump.net/software/microsoft_access_date_picker

You'll have to wire it up manually, but I find the effort totally worth it for date picker "control" (its actually a modal Access form) that works better and is more flexible.

voon
Thanks for the link voon, but it was agreed to not utilize that date picker. The app already includes 3 other date pickers, so the decision was made to use another since the users are accustomed to the Access ones. Granted, there is a whole bunch of crazy voodoo going on in the background to make them work. But thanks again for your advice!
JPM
I find Stephan Lebans wrapper around the Windows calendar control to be esthetically more pleasing: http://www.lebans.com/monthcalendar.htm
David-W-Fenton
Hmmmm... another great link! Thanks David. It's times like these where I had a little more control over the design of the app...
JPM
A: 

After some more research, there seems to be a bug with using the date picker on tabs. Although my date picker was storing the right data in the database, it just wasn't displaying the value.

Apparently, you have to set focus to date picker before the value is to display. So on my tab change event, toggle control click event (and others) I set focus to the date picker, and now it is displaying the appropriate values. Took a lot longer than I wanted to, but what can you do?

JPM
Which version of Access was this? You do know that the calendar OCX was dropped in A2010, right?
David-W-Fenton
The version of Access this app is Access 2003. And from what I've heard, no further developments will be done in Access. They just have to support it...
JPM
Overheard in 1990: Well, this app will be replaced well before 2000 rolls around, so we really don't have to worry about fixing the Y2K problems.
David-W-Fenton
LOL! Well, I'm only telling you what they told me. But I have a feeling they'll be using Access again.
JPM
I just feel it's inevitable when somebody says "never" that "never" will arrive sooner than anybody expects. Removing the dependency on the calendar OCX now would mean that somebody later will have a lot fewer headaches. Given that you've got the issues in your head right now and the alternatives laid out for you, it seems to me that you are best equipped to fix it most efficiently for the long term. At least, that's the way I think about these kinds of things.
David-W-Fenton
True David, but I am not in the position to argue for removing them any more than I have. After all, they own the app, and it will be there long after I am done my summer co-op term. In other words, I have no stroke there.
JPM