Solved

Access Query

Posted on 2016-10-13
4
57 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 35

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

809 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