?
Solved

Open Access 2010 drill through with multiple criteria

Posted on 2013-01-12
3
Medium Priority
?
485 Views
Last Modified: 2013-01-12
I am trying to build a drill through sales form.  
When I click on a cell, I want to open another form (frmSingleMonthSales) filtered by a month number (L1, L2M L3...) and customer number.

If I use the line below, the form opens with all sales from Mth L1
DoCmd.OpenForm FormName:="frmSingleMonthSales", WhereCondition:="Mth= 'L1'"

If I use the line below, the form opens with all orders for the proper customer
DoCmd.OpenForm FormName:="frmSingleMonthSales", WhereCondition:="ID_CUST_SOLDTO = '" & Me.txtIdCust & "'"

When I combine the lines as below, I get a Run-Time error 13 Type mismatch
DoCmd.OpenForm FormName:="frmSingleMonthSales", WhereCondition:="Mth= 'L1'" And "ID_CUST_SOLDTO = '" & Me.txtIdCust & "'"

If the each of the first two lines work, why won't the combined line work.

Any help will be appreciated
0
Comment
Question by:Scamquist
[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
3 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 38770503
WhereCondition:="Mth= 'L1' AND ID_CUST_SOLDTO = '" & Me.txtIdCust & "'"
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38770522
In addition to Ron's correction, if your Customer ID is  numeric, drop the single quotes that are delimiting txtIdCust  as text:

 WhereCondition:="Mth= 'L1' And ID_CUST_SOLDTO = " & Me.txtIdCust 

Open in new window

0
 
LVL 1

Author Closing Comment

by:Scamquist
ID: 38770551
Thank you for the assist.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

770 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