I have a date field that I want to pre-populate with today's date when a new record is created.
I've put the following in the control source property, I've put
But maybe this is a bad thing? When i try to save the record, the system tells me that this field cannot be null.
Also, I actually don't want "mm/dd/yyyy". Ideally, it should be "mm/dd/yy" but i noticed that whenever I do this, it's rejected by the table.
Does the "date/time" data type only accept 4 digit dates? I'm going to be exporting this data to csv... so as long as I find a way to export it in the "yy" format, I don't care how it's saved in the database.
Store the date as a date and time format in the database you will thank me later also don't call the feild "date"
when you go the export it you can format(datefeild,"mm/dd/yy")
what i do is export as format(datefeild,"dd mmm yy") most importer will see this as a date
I have had heaps of problem with 01/05 or 05/01
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
The problem you are/were having is the Control Source is resonsible for binding the form field to the data field in the table. In the Control Source you posted, you do not reference the table's field where the data will be stored. Therefore, the data is not being stored. When you try to save that data field has no value, so you get the error.
Yes. That is what I would do. Now, you have a choice, set the default value at the form level or the table level. When you set it at the table level, no matter how you enter the data, using a form or directly in datasheet view, the default is added. If you have it at the form level, then different forms can have different default values. If that is not important then I would put it at the table level.
if i do this, (on the form or table level) what will happen if i'm navigating through previously created records? Will the system overwrite the old date and put today's date in it?
I guess I could just test this on my own... sorry to bug you.