Solved

Access Query

Posted on 2016-10-13
4
62 Views
Last Modified: 2016-10-27
I have a macro running a series of queries. I keep getting the following error:
"This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."
I'm basically running reports for different projects. I select the project name from a combo, then I hit a command button (initiates a macro) to generate the results based on that project. It has worked for a number of projects, but when I select certain projects it doesn't work. There are no special characters in the project names either.
Not sure what would be causing this?
0
Comment
Question by:melinhomes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 36

Expert Comment

by:PatHartman
ID: 41842124
If it works for some projects but not others, it is most likely a data issue.  You will need to run the steps of the macro one at a time to isolate the problem.  I'm not sure we will be able to resolve this without the actual database and since you shouldn't load private data to this site, we'll just hold your hand as you work through this.
0
 

Author Comment

by:melinhomes
ID: 41842142
1, qryAccreditedTrainingOnProject, ExcelWorkbook(*.xlsx), \\mfile2\Sustainabilty Team\Sustainability Tool\MelinCommunityBenefitsTool2\ValueWales\Training\AccreditedTrainingOnProject.xlsx, No, \\mfile2\Sustainabilty Team\Sustainability Tool\MelinCommunityBenefitsTool2\ValueWales\Training\AccreditedTrainingOnProject.xlsx, , 0

Above is the message, I assume its the query? (tables are sql tables). If I remove this column from the query, it seems to run? Yet it worked on others!!!

Start Date
Between [tblProjectTeam]![StartDate] And Now()

Think this is what is causing it...
0
 

Author Comment

by:melinhomes
ID: 41842165
Hi Pat

Thanks for this, I will check the data in the underlying tables tomorrow and let you know how I get on. If that doesn't work, ill run the queries one by one.

Thanks
Gareth
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 41842525
In the query (go to design), specify as Parameter:  

    [tblProjectTeam]![StartDate]  

and select Date/time as data type.

/gustav
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access, hourly employee status 8 43
Hide shared folder for some users 2 30
Options for Linking SQL tables to Access 2013 9 42
Error 438 6 15
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question