DateAdd Function

T

TeeSee

Attempting to place this in a query .... DueDate: DateAdd("y",3,
[MyDate]) returns an error message "undefined function 'DateAdd' in
expression"

Also placing =DateAdd("y",3,[MyDate]) in the control source in a text
box also gives me th #NAME? error. Looked like I was doing it
according to microsoft and Doug Steele. Where am I going wrong?

Thanks
 
G

gumby

Attempting to place this in a query .... DueDate: DateAdd("y",3,
[MyDate]) returns an error message "undefined function 'DateAdd' in
expression"

Also placing =DateAdd("y",3,[MyDate]) in the control source in a text
box also gives me th #NAME? error. Looked like I was doing it
according to microsoft and Doug Steele. Where am I going wrong?

Thanks

DueDate: DatePart("y",[MyDate])+3
 
G

gumby

Attempting to place this in a query .... DueDate: DateAdd("y",3,
[MyDate]) returns an error message "undefined function 'DateAdd' in
expression"

Also placing =DateAdd("y",3,[MyDate]) in the control source in a text
box also gives me th #NAME? error. Looked like I was doing it
according to microsoft and Doug Steele. Where am I going wrong?

Thanks

DueDate: DateAdd("y",3,[MyDate])

May have something to do with your library references.
 
G

gumby

Attempting to place this in a query .... DueDate: DateAdd("y",3,
[MyDate]) returns an error message "undefined function 'DateAdd' in
expression"
Also placing =DateAdd("y",3,[MyDate]) in the control source in a text
box also gives me th #NAME? error. Looked like I was doing it
according to microsoft and Doug Steele. Where am I going wrong?

DueDate: DateAdd("y",3,[MyDate])

May have something to do with your library references.

DueDate: [MyDate]+3
 
F

fredg

Attempting to place this in a query .... DueDate: DateAdd("y",3,
[MyDate]) returns an error message "undefined function 'DateAdd' in
expression"

Also placing =DateAdd("y",3,[MyDate]) in the control source in a text
box also gives me th #NAME? error. Looked like I was doing it
according to microsoft and Doug Steele. Where am I going wrong?

Thanks

Are you trying to add 3 days or 3 years to [MyDate]?

3 Days would be DateAdd("d",3,[MyDate])
though DateAdd("y",3,[Mydate]) will work also.

3 Years would be DateAdd("yyyy",3,[Mydate])

If you are getting an "undefined function" error then check your
references.

Open any module in Design view (or click Ctrl + G).
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.

For even more information, see
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
 

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