I have a form based on a query based on a table.
I imported the original table from another database. I initially failed to realize the problem with a field in that table named “Date”. I set up a query using the same name, then a form to display the info with that same field name.
Now, when I try to do an auto-fill-in of the Date in the BeforeInsert event (this is a notes type of form), I run into a problem. Access has redefined Date from a function to a field. So when I try
Me!Date.Value = Date()
the Date field does not change.
I have gone through the entire database and changed all field names from Date to UpdateDate. I have thoroughly scoured the entire database to remove all references to the old date field. I have saved, compacted, and decompiled the database, all to no avail. Because when I try again to enter this line in the BeforeInsert event
Me!UpdateDate.Value = Date()
I get an error stating that my database “can’t find the field “Date” referred to in your expression”. It also removes the parenthesis after Date.
When I highlight and right click on the word “Date” in the BeforeInsert event module and click on “definition”, I get the definition as an access field under my form. If I go up to the DateTime section in the classes window and go to Date in the member window and click on it there, it defines date as a variant under VBA.datetime (the correct one for the date function).
So both “Date” definitions exist.
I have also tried to highlight and copy the correctly defined Date from the object browser window and paste it in the module, but access still uses the wrong Date field definition in the module.
How do I get rid of the no longer existing definition of Date as a field in the classes and members area so that access will stop referring to a long dead field?
I imported the original table from another database. I initially failed to realize the problem with a field in that table named “Date”. I set up a query using the same name, then a form to display the info with that same field name.
Now, when I try to do an auto-fill-in of the Date in the BeforeInsert event (this is a notes type of form), I run into a problem. Access has redefined Date from a function to a field. So when I try
Me!Date.Value = Date()
the Date field does not change.
I have gone through the entire database and changed all field names from Date to UpdateDate. I have thoroughly scoured the entire database to remove all references to the old date field. I have saved, compacted, and decompiled the database, all to no avail. Because when I try again to enter this line in the BeforeInsert event
Me!UpdateDate.Value = Date()
I get an error stating that my database “can’t find the field “Date” referred to in your expression”. It also removes the parenthesis after Date.
When I highlight and right click on the word “Date” in the BeforeInsert event module and click on “definition”, I get the definition as an access field under my form. If I go up to the DateTime section in the classes window and go to Date in the member window and click on it there, it defines date as a variant under VBA.datetime (the correct one for the date function).
So both “Date” definitions exist.
I have also tried to highlight and copy the correctly defined Date from the object browser window and paste it in the module, but access still uses the wrong Date field definition in the module.
How do I get rid of the no longer existing definition of Date as a field in the classes and members area so that access will stop referring to a long dead field?