[Solved] Variable Dates

Discuss the database features
Post Reply
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

[Solved] Variable Dates

Post by Fao »

I'm really just learning this program this morning, had OO for a while now but haven't used Base much if at all. I watched a video I found from a post on here and got the database looking more or less how I want it to but the date fields in my db are a problem. In the date field called "Date Created" (what I called in in table view, when I was creating it) I would be okay with that date being the current date, as that is what the field is all about, the date that I am actually creating a record, but in the other two that I created as date fields (not date/time stamp, but date), those dates will vary. Regardless of what I do, it just inputs the current date, and also does not use the format I select in table view (when I'm creating the field, at the bottom there is a box where you can choose from like fifteen different date formats, perhaps "YYYY/MM/DD" and "December 13, 1999" would be two of the options - I chose the option similar to the latter, the month spelled out). I can type letters or numbers or whatever I want, into the form when I am in form view (what I normally use when I am entering information into a db), it just reverts to a digital date format (for example, today is Jan 18, 2018 it enters "18-01-18"). That format is entirely different from what I selected when I created it in table view, and defaults to the current date. How can I make it look the way I want (month spelled out, etc...) and how can I enter dates of my choosing?
Last edited by Fao on Sun Jan 21, 2018 12:19 am, edited 1 time in total.
OpenOffice 4.1.2 on Windows 7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Variable Dates

Post by Nocton »

It looks as if you are using a form to enter data, which is the best way. But have you set the date format in the control on the form?
OpenOffice 4.1.12 on Windows 10
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Variable Dates

Post by Fao »

Thanks for that reply, I am a little further ahead than I was when i posted this question yesterday. I was trying to do this from the table view, yesterday when I was working on this, if I would select forms, then right click on that form and select edit, I would get the grid but with no fields, just a blank grid and the ability to start typing things at the top (or maybe elsewhere as well). Today when I right click on the form and select edit, I get what I was expecting, the grid but with the existing fields. I still have the same problem, though, if I were to click on a field (puts the squares around it so I can move it) then right click and select control, I get some choices but none of those address what I am trying to do here (change it from automatically entering the current date, regardless of what I type), and allowing me to enter any date of my choosing.
OpenOffice 4.1.2 on Windows 7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Variable Dates

Post by Nocton »

I assume that the control has been associated with the date field in your table?
Perhaps you could upload your odb file so we can see where the problem is.
OpenOffice 4.1.12 on Windows 10
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Variable Dates

Post by Fao »

Alright, I uploaded the file. To be clear about how I got here, though, I chose to create a new db; you have to start with a table so I went into the wizard to create a table, for each field I entered a name (the three are called "Date Created", DOFC, and DOLC - these are the three date fields); I tabbed (or used the mouse pointer) to the field type box and selected "Date"; I entered some text to describe the field in the next box, to the right of the field type box; down below there are three boxes, I chose "no" for entry required, entered nothing into the default value box (but there seems to be a set in stone default value for this and all other date fields on all records in the db), and chose a date format (but a different one, with a set in stone date, is used on all date fields). Hope this helps you figure this out.
Attachments
NewEmpLawy.odb
(14.36 KiB) Downloaded 202 times
OpenOffice 4.1.2 on Windows 7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Variable Dates

Post by Nocton »

Thank you. It all works OK with me - I enter the date and it is saved. Every date field is the OK.
So I cannot see your problem.
OpenOffice 4.1.12 on Windows 10
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Variable Dates

Post by Fao »

This is the problem, in any date field of any record, if I type a "1" then tab to the next field it changes the "1" to "18-01-18"; if I go to a different date field, on that record or a different one, and type "19012018", when I leave that field it changes the data to "18-01-18"; if I go to a different record and select any of the three date fields and type "[6thl;g.l[dpflk", when I leave that field it changes that to "18-01-18". I can put whatever I want in date fields, but as soon as I navigate away from the box it automatically changes to that date (in that format - as you can see I chose the format, January 1, 1999, for example).
OpenOffice 4.1.2 on Windows 7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Variable Dates

Post by Nocton »

If you have a date field then you need to give it a date. Just typing 1 is not a date, so Base tries to make some sense of it and as far as I can see uses the last date entered for that field. Type 1/1 and you get 01/01/18 with the format you have chosen. This seems to me to be reasonable behaviour.

However, I suggest you choose Dropdown = Yes in the Properties of the Date field and that will then give you the date picker, which will limit what can be entered and is more user-friendly.
OpenOffice 4.1.12 on Windows 10
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Variable Dates

Post by Fao »

Thanks for taking a shot at it, but like I said I can type anything I want into those fields, it will change it to "18-1-18" There are a thousand ways, with tiny differences, to enter a date, I did not try every last one, but I tried the most commons ways (including starting with the month, typed out, like I specified in the table view when I was creating the db). When I say I tried the most common ways, this obviously implies I tried other things, such as "1/1/18", 3/2/2017", "02-11-16", etc...Just to be sure, I tried two different date fields on two different (new) records before sending this reply, I entered dates (using both the first and the last two digits as the year, and numbers twelve of less for the other two) into the two fields on a new record; in both cases, once I pressed the tab button, whatever I typed in there for a date changed to "18-1-18". The program obviously thinks this is the only allowed data for any date field, but I cannot see where it is thusly set.
OpenOffice 4.1.2 on Windows 7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Variable Dates

Post by Nocton »

As I said, I don't see that behaviour here and I have several Base applications with dates, so it looks as if it is some peculiarity in your set-up.
But try the Dropdown/Date Picker - that will solve your problem.
OpenOffice 4.1.12 on Windows 10
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Variable Dates

Post by Fao »

I would love to try that, would be interesting to see if date fields in this db would accept any other data from a predefined source like a calendar from a drop down arrow, but like I said earlier there is no such thing available with any of the date fields.
OpenOffice 4.1.2 on Windows 7
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Variable Dates

Post by UnklDonald418 »

If you used the Form Design Wizard to create your form it groups the control with a label so when you click on the control you don't get just the control you get the group which has a different set of properties. When you right click and select Control look at the dialog title in the upper left of the Properties dialog it will probably display Properties: Multiselection.
Hold down the <Ctrl> key when you click the date field, which should select only the date control. You can verify this with the green handles, they should surround only the date box and not include the label. Now right click and select Control the dialog title should now display Properties: Date Field and the list of properties should have more options including Date format, Default date, and Dropdown.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Variable Dates

Post by Villeroy »

@Fao
Which locale is set in Tools>Options>Language Settings>Languages? This info is vital to reproduce the behaviour on your machine.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Variable Dates

Post by Fao »

Thanks for that info, that is exactly what I was struggling with, how to change from "Mulit" to control of one field specifically, that did the trick. I'm not exactly sure what the problem was before, I guess the program didn't like the way I was entering dates (I tried many different ways), but the first thing I did once I was able to control the one field is I went to a date field and back spaced over the last digit (changed 18 to 17), and it worked, but with the drop down calendar this is not an issue.

I do have another issue, though, this is making text wrap to to the next line in a memo field. Maybe setting it to memo (as opposed to text) in the table view when I created the db is the problem, but there is one field called comments that is rather large, I gave it 600 characters; the problem is that data does not fit in the width of the box, rather than the cursor going to a new line, it just keep entering characters to the right on the same line (I tried the "enter" button like you might do in a word processor). This is a tall box, a few lines of text would be a lot easier to read than one line extending far beyond the right hand border of the box, how do I tell that field to fit data only on the visible part of the box, to go to a new line below the current one, when I am at the right end of the box?
OpenOffice 4.1.2 on Windows 7
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Variable Dates

Post by UnklDonald418 »

Look down the list in a Properties: Text Box dialog for the Text Type property. It defaults to Single-line but has a couple of Multi-line options.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Post Reply