Page 1 of 1

[Solved] Date not correct - Newbee Question

Posted: Thu May 29, 2008 2:56 pm
by harmlessharman
I have set a date on my table to DD/MMM, and it is showing correctly on the table e.g. 31/Dec. However in my Form the same date keeps getting the year added e.g. showing as 31/12/08. How can I get the date on the form to be the same as the date in the table?

Re: Date not correct - Newbee Question

Posted: Thu May 29, 2008 5:11 pm
by Villeroy
So the date value is correct, but you want a different formatting.
Call "Edit" from the form's context menu.
Menu:View>Toolbars>Form Design

a) If your date-control is a single box:
Call the "form navigator" (compass icon)
Pick the date-control from the navigator
b) If your date-field is shown as column in a single grid-control:
Right-click the date's header

In the properties dialog there is a property "Formatting" with a [...]-button.
Click that button and adjust the number format.
Save the form and close it.
Save the database document.

Re: Date not correct - Newbee Question

Posted: Wed Jun 04, 2008 11:18 am
by harmlessharman
Thanks for your help.

I have looked at the Navigator and I do not have a date option. The only options are :- Headings, Tables, Text Frames, Graphics, OLE objects, Booklmarks, Sections, Hyperlinks, References, Indexes, Notes and Draw Objects.

As I said on the table I changed the date format to DD/MMMM e.g. 31/Dec but on the form it shows up as 31/12/08 and I do not want the year. :?

Re: Date not correct - Newbee Question

Posted: Wed Jun 04, 2008 12:14 pm
by Villeroy
"The Navigator" (key F5) is a different animal. The form navigator is available when a form is loaded in edit mode. It lets you browse all forms, controls and subforms attached to a document (all forms are Writer documents).
The form in this database contains a micro-tutorial:
http://user.services.openoffice.org/en/ ... hp?id=1266

Re: Date not correct - Newbee Question

Posted: Thu Jun 05, 2008 12:46 pm
by harmlessharman
Thanks for your help once again.

I have finally got it! Inthe Date Field Properties there is not an option for DD/MMM as there is in the Table. So although I have set the date as DD/MMM on the Table it cannot be shown as this on the form, hence why it keeps adding the year.

Thanks again

Re: Date not correct - Newbee Question

Posted: Thu Jun 05, 2008 1:01 pm
by Villeroy
So your form displays dates in a generic text-box with no option to set any number format. I forgot to mention that you can convert such a generic box to a more specialized control. Right-click the text-box in the forms navigator (the box alone without it's label), "Replace with">"Date Field". You get some amazing new options to use number formats, spin buttons and drop-down calendars.
Beware: Recently I found a bug which does not allow for "military dates" such as "YYYYMMDD" or similar without any separators. http://www.openoffice.org/issues/show_bug.cgi?id=89532
 Edit: I see that a box of type "date field" offers a limited set of date formats (always including year). So this seems to be what you have already. Try to convert your box to "formatted field", which offers all kinds of numeric formats, including userdefined.