Error 3075

D

David McKnight

I get a error message when I add the following to code to build a query:

"IIf(Format([Scores].[Date],'ww')="",54,Format([Scores].[Date],'ww')) AS
Week "

It runs fine as part of a query design but not as code in a form.

It works in the code if I remove the IIF statement
 
D

Douglas J. Steele

Try using a different alias than Week (for that matter, consider renaming
your table field something other than Date). Both Week and Date are reserved
words, and you should never use reserved words for your own purposes.

For a comprehensive list of names to avoid (as well as a link to a free
utility to check your application for compliance), see what Allen Browne has
at http://www.allenbrowne.com/AppIssueBadWord.html
 
K

Kelvin Sparks

The [Scores] part of the expression refers to a table name in your query.
When using that code on a form, make it point to the textbox that holds that
data.


IIf(Format(Me.TxtDate,'ww')="",54,FormatMe.txtDate,'ww')) AS
Week
 

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