Default Date Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Last September, I added a field in an existing table and set the default to
"Date()". It worked fine when i added records to the table or with a form.

The other day I had too much time on my hands, and changed the
tools>options>general>4-year format choice. This may have caused problems.

Now, when I click the form's ">*" (end of file +1) to add an new record,
MSACESS.EXE crashes. If I remove the field's "Date ()" default, the new
record can be added. As a test, if I add a new field in the table (thinking
that the old field was corrupted somehow) and to the form, the new field
with its Date() causes a crash. There is no problem when a new record is
added to the table directly.

Any thoughts? Using latest and greatest Access.
 
The 4-digit year was a panic addition around the Y2k time. It is worse than
useless, as it overrides the correct date format. For example, if you format
a credit card expiry date as MMYY and turn on the 4-digit year, you get a
6-digit result: not useful.

But AFAIK, the 4-digit year settings do not crash Access. The bug is most
likely related to Name AutoCorrect. There are numerous cases where this
"feature" will crash Access. Some 16 related bugs are listed in this
article:
http://allenbrowne.com/bug-03.html

After you uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
compact the databse:
Tools | Database Utilities | Compact
Then decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
And then compact again.

If the form has a subform, there is another bug where Access can crash if
the field named in the LinkChildFields is not represented by a control on
the subform. In this case, the reference is to an object of type
AccessField, and the bug seems to be related to this type. By adding a
control to the subform, the references it to an object of type TextBox, and
so you circumvent the bug. Then save the subform, change something on the
main form (to force Access to evaluate the change), save, and compact.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

""Jack" of all trades, master of none" <"Jack" of all trades, master of
(e-mail address removed)> wrote in message
news:[email protected]...
 
Back
Top