Selasa, 15 November 2016

Re: [MS_AccessPros] Set date type fields settings

Khalid-

Perhaps a solution is to use an unbound text box. In the Current event of the form, load it with the mmm-yyyy of the underlying date/time field. In AfterUpdate of the control, check that it's valid. If not, display an error and put the focus back in the box. If it is valid, update the underlying field value in the Record Source.

Yes i am using these both fields "MfgDate" and "ExpDate" as Date/Time Data type and further at some instances items expired and expiring within one month these are used and calculated, and displayed as Notifications on Main Menu and in reports.

One solution would be to change the data type from Date/Time to Text, but that's probably not a viable solution. As you've probably noticed, when you supply only the month and the year to update a Date/Time data type, you always get 1 as the day part value. How are you using this field in your application?

That's telling me that you cannot trap the error in code. Access is grabbing it before your code can run. You could try setting the Validation Text property in the table to see if that makes a difference.

After entering correct month abbrv. a msgbox displays the month abbrv. like Jan, but on wrong month abbrv. entered i am still waiting to see my custom message, instead i get the Access message "The text you entered....."

Currently i have to enter date like 01/01/2016. I need to enter data like Jan-2016 and set the check if month is mis-spelled i.e apart from Jan to Dec, my custom msgbox should open. I did tried with input mask--> LLL\-0000;0; and was able to enter like Jan-2016 but i was unable to display my custom msgbox if month part is mis-spelled, Access opens its built in message As below: The value you entered isn't valid for this field. For example, you may have entered text in a numeric field or a number that is larger than the FieldSize setting permits.

With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.