Form not displaying date/time as explicitly formattd (1 Viewer)

FLJerseyBoy

Registered User.
Local time
Today, 03:55
Joined
Jul 27, 2018
Messages
18
A simple form includes a text box holding a date/time field (on SQL Server back end, if that matters); the format explicitly set in the form design is "mm-dd-yyyy." It works exactly as expected... except on ONE user's computer. (And it only happens on that user's desktop, not his laptop!) On that computer, the field displays as if it were formatted "yyyy-mm-dd hh:nn:ss" (i.e., including the full time as well as the date).

At first I thought it must be just a simple Windows setting -- overriding the explicit format for some reason. But it happens only in this ONE control; I've got other date/time fields on the same form which behave as expected.

But there's one thing different about this control: it has conditional formatting (foreground/background colors) applied.

So my question is: does conditional formatting cause the control's Format property to be ignored?

TIA for any advice.
[EDIT TO ADD: but then again, why only on this one computer?!?]
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 03:55
Joined
Oct 29, 2018
Messages
21,467
Hi. Welcome to the forum. I think you're maybe right. What happens if you temporarily disable the conditional formatting for testing purposes? Does the date format change?
 

FLJerseyBoy

Registered User.
Local time
Today, 03:55
Joined
Jul 27, 2018
Messages
18
Follow-up: deleting the conditional formatting has no effect on the way the field is formatted.


(I'd just change it to a properly formatted string if I didn't need to do some calculations with the date.)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:55
Joined
Oct 29, 2018
Messages
21,467
Follow-up: deleting the conditional formatting has no effect on the way the field is formatted.

(I'd just change it to a properly formatted string if I didn't need to do some calculations with the date.)
Then perhaps this copy of the control may have gotten corrupted. What happens if you add a new textbox bound to the same date field and format it?
 

FLJerseyBoy

Registered User.
Local time
Today, 03:55
Joined
Jul 27, 2018
Messages
18
That's something good to try, thanks again. I'll give that a shot next time I'm at that computer.


(Just saw the "banging head against brick wall" smily. Probably should've employed that by now...)
 

FLJerseyBoy

Registered User.
Local time
Today, 03:55
Joined
Jul 27, 2018
Messages
18
As a quick-and-dirty sanity check, instead of rebuilding that control from scratch, I re-copied the front end from the main distribution server where all users get their copy. No difference: his one PC stubbornly displays that field incorrectly, even though all other users of the same front end have no problem. (In other words: wouldn't their displays register the "corrupt" control the same way?) I'll try to do a workaround; this is driving both of us nuts.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:55
Joined
Oct 29, 2018
Messages
21,467
As a quick-and-dirty sanity check, instead of rebuilding that control from scratch, I re-copied the front end from the main distribution server where all users get their copy. No difference: his one PC stubbornly displays that field incorrectly, even though all other users of the same front end have no problem. (In other words: wouldn't their displays register the "corrupt" control the same way?) I'll try to do a workaround; this is driving both of us nuts.
Right. After you confirm it's not a corrupt control, then perhaps we'll have to look closely at the specific computer for something different there.
 

FLJerseyBoy

Registered User.
Local time
Today, 03:55
Joined
Jul 27, 2018
Messages
18
No change once I recreated the control. Because I will be going out of town next week and can't solve it immediately, I built a rather ugly workaround:

  • Added another text box (call it NewControl) to the form
  • Set its value to Format([OriginalControl], "mm-dd-yyyy")
  • Repeated the conditional formatting for the new textbox
  • Set the Visible property for OriginalControl to false
  • Overlaid OriginalControl with NewControl
Luckily, the control is display-only (it's a column on a continuous subform) and doesn't have to be accessed by the user. Leaving OriginalControl's name unchanged means that the VBA-based, behind-the-scenes sorting and filtering can continue with no change.


Will revisit and close this thread if I ever find out why it's happened in the first place -- especially if I can fix it!


Thanks for help, DBGuy!
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 03:55
Joined
Oct 29, 2018
Messages
21,467
No change once I recreated the control. Because I will be going out of town next week and can't solve it immediately, I built a rather ugly workaround:

  • Added another text box (call it NewControl) to the form
  • Set its value to Format([OriginalControl], "mm-dd-yyyy")
  • Repeated the conditional formatting for the new textbox
  • Set the Visible property for OriginalControl to false
  • Overlaid OriginalControl with NewControl
Luckily, the control is display-only (it's a column on a continuous subform) and doesn't have to be accessed by the user. Leaving OriginalControl's name unchanged means that the VBA-based, behind-the-scenes sorting and filtering can continue with no change.

Will revisit and close this thread if I ever find out why it's happened in the first place -- especially if I can fix it!

Thanks for help, DBGuy!
Hi. Glad to hear you found a workaround. Keep us updated if you find the real cause of the problem. Cheers!
 

Users who are viewing this thread

Top Bottom