Date() Function not available - Name conflict

G

Guest

By oversight I named one of my fields "Date" in the SQL stmt for a form. I
realized the error of my ways so I changed the name of the field from "Date"
to "ApptDate" so as not to conflict with the system's Date() function. I also
replaced all instances of the field name "Date" in the VBA code and in all
the controls on the form that referenced that fieldname.

The Problem: Now I need to use the Date() function to do a couple
calculations in VBA and it doesn't work. Whenever I enter "Date()" in the
form's VBA it removes the parentheses () and just leaves "Date". Further,
whenever I open the form it asks me to supply a "Date" parameter.

Could that old "Date" fieldname still be stored somewhere deeper than the
SQL stmt and VBA code? I've checked all the VBA and all the controls on the
form for references to "Date" and there are no more...

I'm wondering if I should just copy all the controls onto a new form,
recreate the SQL statement and copy over the VBA? I'll try that next, but if
there's an easier way, then of course I'm interested in it.

Stuck...

Any help would be great. Thanks!
 
G

Guest

Okay, I answered my own question. I forgot about the command button that
opens the form - it uses an OrderBy argument that references the "Date"
fieldname. All is well.

Oops!
 
A

Albert D. Kallal

Whenever I enter "Date()" in the
form's VBA it removes the parentheses () and just leaves "Date". Further,

the above is actually correct behaviour...the () are removed by the code
editor....
whenever I open the form it asks me to supply a "Date" parameter.

That means you have a control called date on your form, or you have some
expression such as dlookup, or something else that is looking for that field
called date that you fixed.....

Could that old "Date" fieldname still be stored somewhere deeper than the
SQL stmt and VBA code? I've checked all the VBA and all the controls on
the
form for references to "Date" and there are no more...

It must be there some where. Make a copy of the form..and then start deleing
things until the problem goes away.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top