Solved

Access Query

Posted on 2016-10-13
4
34 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
  • 2
4 Comments
 
LVL 34

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 49

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now