Change Date Format

G

Guest

I am trying to print a date field as 2 character(s) Month, 2 Character(s)
day, "Need Leading Zeroes", and two diget year.

I select properties on my date field. Go to my Format Tab, and on the
Format Line have tried for days to enter the syntax it wants.

It is hard to say how many I tried!

Can I just put the format in this text box without having to try to learn VBA?

Thank You for any help!

John Q
 
M

Marshall Barton

John said:
I am trying to print a date field as 2 character(s) Month, 2 Character(s)
day, "Need Leading Zeroes", and two diget year.

I select properties on my date field. Go to my Format Tab, and on the
Format Line have tried for days to enter the syntax it wants.

It is hard to say how many I tried!

Can I just put the format in this text box without having to try to learn VBA?


If the text box is bound to a date/time field, then setting
the text box's Format property to:
mmddyy
will do what you want. If your problem is that you always
get 4 digit years even when the format is yy, then use the
Access Tools - Options menu item, General tab and uncheck
the Use four-digit year format options.

If the field (in a table) is a Text field, then all kinds of
funny things might happen.
 
J

John Spencer

You should be able to set the format property of the control to
"mm/dd/yy"
to get it to show 06/01/05 for June 6, 2005

Is that what you have tried?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Barton;

Thanks for getting back to me. The data is in a field in a table.
The field is defined as a Date/Time Field.

Still having trouble.

Thanks Again

John
 
G

Guest

John;
Thanks for getting back to me. Yes I have tried this and all I get
on the report is #Name?

The data comes from a field in the table defined as a Date/Time field.

Still fighting the problem. I have called some programmers who know
Access and they are also trying to help. I can change my whole application
around, but the IBM guys are really having a ball at my expense.

Thanks Again.

John
 
J

John Spencer

The name error usually occurs for a different reason.

Make sure you are settig the format PROPERTY for the control. If you are
entering

=Format([myDateField],"mm/dd/yy") as the control source and the control's
name is "MyDatefield" you will get an error. Access can't tell if you mean
to the date field or the control. If you are doing this try changing the
name of the control to txtMyDateField.

As I said, you should probably have the control's format properties set as
below

Format: "mm/dd/yy" (on Format tab of the properties dialog)
Control Source: [MyDateField] (on the data tab of the properties dialog)

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
J

Jaazaniah

The name error usually occurs for a different reason.

Make sure you are settig the format PROPERTY for the control. If you are
entering

=Format([myDateField],"mm/dd/yy") as the control source and the control's
name is "MyDatefield" you will get an error. Access can't tell if you mean
to the date field or the control. If you are doing this try changing the
name of the control to txtMyDateField.

As I said, you should probably have the control's format properties set as
below

Format: "mm/dd/yy" (on Format tab of the properties dialog)
Control Source: [MyDateField] (on the data tab of the properties dialog)

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.




John;
Thanks for getting back to me. Yes I have tried this and all I get
on the report is #Name?
The data comes from a field in the table defined as a Date/Time
field.
Still fighting the problem. I have called some programmers who know
Access and they are also trying to help. I can change my whole
application
around, but the IBM guys are really having a ball at my expense.
Thanks Again.

"John Spencer" wrote:

- Show quoted text -

Is the report based on any queries that calculate the date field in
any way? If so, you might try wrapping the function a CDate() function
like this;
CDate(MyFunction([MyDateField]))
This will return it as pure date and not Variant(Date)

Also, the #Name? error you reported may be either a typo or a missing/
erronous Control Source for the report. Check the Control Source on
the report (click dark gray area to select the report), if it is bound
to the correct table/query, ensure that the Control Source of the
control returning #Name? matches the name of the desired field exactly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top