Solved Displaying the data format (1 Viewer)

allanc

Registered User.
Local time
Today, 18:50
Joined
Nov 27, 2019
Messages
46
Hello Friends!

I have some fields for user to enter dates. There's two types of fields where one filed's format is mm/yyyy and another field's format is mm/dd/yyyy. The goal here is to ensure user is aware of the date format being used. (mm/yyyy vs mm/dd/yyyy)

Is there an efficient way to show user the format (i.e "mm/yyyy" or "mm/dd/yyyy") when they click on the field to enter a date?

1) I have thought about defaulting the field value to "mm/dd/yyyy" but this is causing some problems as we use a lot of "IsNull()" in our codes. Maybe we can use IsDate() instead?

2) I tried adding a label nearby the field indicating the format but this is making the form messy.

3) Adding a date picker doesn't seem working well as it takes sometime to select a desired year.

I feel like there's an built-in tool to achieve this. I am really new to MS Access to any help on this is greatly appreciated.

Happy holidays!
Allan
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:50
Joined
Aug 30, 2003
Messages
36,118
Perhaps an input mask, plus setting the Status Bar Text and/or ControlTip Text properties?
 

Ranman256

Well-known member
Local time
Today, 18:50
Joined
Apr 9, 2015
Messages
4,339
I use a label so they know the format.
using: mm/yyyy will set the date to mm/1/yyyy
 

allanc

Registered User.
Local time
Today, 18:50
Joined
Nov 27, 2019
Messages
46
Perhaps an input mask, plus setting the Status Bar Text and/or ControlTip Text properties?

Thank you Paul!

I have tried Input Mask - which showed "slashed" in the field.

ControlTip does what I need here but it seems like user needs to hover mouse over to the field for about 2 seconds until the text(mm/dd/yyyy) shows. Are we able to make the text show quicker?

Thanks!
Allan
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:50
Joined
Oct 29, 2018
Messages
21,358
Hi Allan. Maybe it's a little bit harder, but you could try using unbound Textboxes for your date input and just validate them before storing into the table fields. You will have to work harder; but also, maybe you'll get the "user experience" you're looking for. Just a thought...
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:50
Joined
Aug 30, 2003
Messages
36,118
Thank you Paul!

I have tried Input Mask - which showed "slashed" in the field.

ControlTip does what I need here but it seems like user needs to hover mouse over to the field for about 2 seconds until the text(mm/dd/yyyy) shows. Are we able to make the text show quicker?

Thanks!
Allan

Did you try the status bar text? The user would need to know to look down there.
 

allanc

Registered User.
Local time
Today, 18:50
Joined
Nov 27, 2019
Messages
46
Did you try the status bar text? The user would need to know to look down there.

Hey Paul - I just read an article explaining Status Bar Text. It seems really useful and certainly something good to know for future

I think I will go with the harder way - I will set the default value and adjust the codes.

Thanks everyone! :D
 

isladogs

MVP / VIP
Local time
Today, 22:50
Joined
Jan 14, 2017
Messages
18,186
You might be interested in my Better Date Picker. It is much faster when you need to change years, is more flexible than the built in version and can be programmed

There are a variety of methods for getting users' attention. Each developer has their own preferences but in my opinion, the two methods mentioned so far both have drawbacks:
1. Control tips are fairly slow to load and don't appear at all if you have a hidden control 'above' the one with the control tip
2. Status bar text is small & out of the way. Its easy to miss messages displayed in the status bar

There is another method which I don't think has been mentioned so far in this thread. I prefer to use a mouse move event to display a message fairly prominently on a form. The message appears immediately when you move over the control and disappears as soon as you move away. By using a large font & brightly coloured text not used for other purposes (I often use magenta for this), the message is very hard to miss.
Of course, the disadvantage is that it can take up more screen space ….

If you want even more ideas for getting users' attention, have a look at my example Attention Seeking database
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:50
Joined
May 21, 2018
Messages
8,463
As Colin points out the built in date picker has some serious limitations, making it hard to get other dates outside the current month and year. A homegrown solution like he provides is more user friendly. I did a slight addition to his code and provided a year month picker in additions. Sometimes you need to get just a year and month. I would still recommend you save this as a real date and in the background it creates a date with the day being any day. I chose the 1st of the month. Then just format to show the month and year part. The main form demos the additional month year picker.

 

Attachments

  • MonthDate.jpg
    MonthDate.jpg
    20.8 KB · Views: 206
  • DatePicker_MonthPicker.accdb
    1.3 MB · Views: 118

missinglinq

AWF VIP
Local time
Today, 18:50
Joined
Jun 20, 2003
Messages
6,423
In the Format Property for a given Control you can do it like websites sometimes do, using a Format of

@;"Please enter date in mm/dd/yyyy format"

or simply

@;"mm/dd/yyyy"

This will appear in the Control until a value is entered.

Linq ;0)>
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:50
Joined
Oct 29, 2018
Messages
21,358
In the Format Property for a given Control you can do it like websites sometimes do, using a Format of

@;"Please enter date in mm/dd/yyyy format"

or simply

@;"mm/dd/yyyy"

This will appear in the Control until a value is entered.

Linq ;0)>
Unfortunately, that will also display the existing date values as a serial number, if the Textbox is bound to a date/time field.
 

Users who are viewing this thread

Top Bottom