Solved

Open Access 2010 drill through with multiple criteria

Posted on 2013-01-12
3
433 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
3 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 500 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

11 Experts available now in Live!

Get 1:1 Help Now