Default a date field to CURRENT_DATE?
Posted: Sat Jun 23, 2018 6:58 pm
I have a date field on my form that I want to default to today’s date when doing data entry. I took three approaches when going at this but all were unsuccessful:
1. Tried changing the field in question at the form level by setting the “Default date” on the Properties pop-up menu (by right-clicking the field and selecting Control), but the little calendar that came up didn’t have a “Today” button on it like it does when actually running the form and doing data entry. So that method was a dead end.
2. Tried changing the Default Value at the Table Design level (near the bottom of the screen) to CURRENT_DATE. It seemed to like this okay but it didn’t “take” because when I came back to it later, it had disappeared. Strike two.
3. I ran the following command on the SQL screen: ALTER TABLE "MyTbl" ALTER COLUMN "MyDateFld" SET DEFAULT CURRENT_DATE. It also liked this okay because I got “command successfully executed” but when I went into my form the field there displayed the date “01/01/1800”. Not good.
So now I’m stumped. Any ideas?
- thx
1. Tried changing the field in question at the form level by setting the “Default date” on the Properties pop-up menu (by right-clicking the field and selecting Control), but the little calendar that came up didn’t have a “Today” button on it like it does when actually running the form and doing data entry. So that method was a dead end.
2. Tried changing the Default Value at the Table Design level (near the bottom of the screen) to CURRENT_DATE. It seemed to like this okay but it didn’t “take” because when I came back to it later, it had disappeared. Strike two.
3. I ran the following command on the SQL screen: ALTER TABLE "MyTbl" ALTER COLUMN "MyDateFld" SET DEFAULT CURRENT_DATE. It also liked this okay because I got “command successfully executed” but when I went into my form the field there displayed the date “01/01/1800”. Not good.
So now I’m stumped. Any ideas?
- thx