VBA Access Specify Field Format for a Date/Time Field - ms-access

I am having issues with changing the Field Format of a existing Data/Time Field.
I want to add a field called "Duration" to a table called "IncidentData" and change the field to show only the hour and minutes information such as "13:44"

It is possible to set the format property of the field to Short Time or hh:nn.
alt text http://ltd.remou.com/access/tableformat.png

Related

Alter Access Field Formats

I have a field that is formatted as a short date. When the field is empty, how do I get text to appear in the field as guidance? For example, I want the field to read "DATE RECEIVED" when empty, but, when completed force a short date entry.
Adjust the Format property of the textbox displaying the value to:
yyyy-mm-dd;;;"DATE RECEIVED"

Setting Default Value of a text Field based on the Value of a Date/Time Field in the Form (MS Access)

I want to set the default vale of a certain field in access form that is based on a date value of another field in the same form.
For Example:-
I Have two Fields as follow:-
TransDate
FinYear
what i want is :-
*when i enter a certain date in field [TransDate], the Field [FinYear] should read the year of date that entered in [TransDate]?
Thansk in Advnce
Use this ControlSource for FinYear: =IIf(IsNull([TransDate]), Null, Year([TransDate]))

Formatting Availble Values list SSRS

I am looking to format a parameter that is a drop down of available values. The format I am looking for is ###-####-###.
Any help would be appreciated.
I would recommend in the SQL procedure you are using as the data set for the parameter to format the values there. This would be the easiest way to format the values you have if you always want to format the field value.
Otherwise you can add a calculated field to the data set and use that as your Label for the parameter. This will allow you to format the Label of the field but keep the Value different.
For instance in my data set GetPhoneNo, I added a field called PhoneNoFormat which is equal to =FORMAT(Fields!PhoneNo.Value, (###)###-####"). I then set the available values for my PhoneNo in my project to PhoneNoFormat rather than PhoneNo.

MSAccess Change Date Value Before Validation

In a grid I have a date/time field where I would like the user to be able to type in short-hand formats for dates and times. For example, if they type in "435p" and then focus off of the cell they get the message "The value you entered isn't valid for this field.". Instead, I want to trap a pre-validationevent and change it to "4:35pm" for them.
What event can I use?
I've tried:
LostFocus & BeforeUpdate: too late (validation fires before event)
Dirty & OnChange: too early (they haven't left the cell yet)
Or is there a way to turn off the native validation rule that is checking for date formats?
You could use an additional text field without formatting (or with your very own format). Then show this instead of the datetime-field and update the date-time field with your code.
Not very pretty, but if you always format the input to a proper time string on before-update and never access this field (but rather the real date-time field) you should be ok. You could even name the field Helper_DateTime or somesuch, so you are never tempted to access the field from anywhere else ;)

Data Type Error when added Input Mask on Date Time Field

i have a date/time field called MyDate. Originally, its format is mm/dd/yyyy and there is no input mask. The Date Picker is also set. I then added input mask using Short date , changed the default input maks to (99-99-0000;;_) and change the format to mm-dd-yyyy. However, when i switch to DataSheet view , all my dates are changed from mm/dd/yyyy to mm-dd-yyyy (which is the correct behaviour right? ) and when I tried to enter a new date or modify existing date, it says "The value you entered does not match Date/Time data type in this column". Plus, the DatePicker is missing. How can I resolve this. thank you
The date time picker is not available if an input mask is applied to a field: http://office.microsoft.com/en-us/access-help/add-and-customize-date-and-time-formats-HA010078108.aspx#_Toc272229486
Regarding the error, have you considered using your regional settings in the control panel, which sets the defaukt date display for all (most?) applications?
Dates in Access are stored as numbers, so you can format them however you like, but I suspect the input mask may need to match the regional settings, although I am not certain.