Solved

Open Args for report

Posted on 2016-07-26
2
15 Views
Last Modified: 2016-07-26
I am having trouble with the following code and need help.  On a form I have  two comboboxes.  One of them named cboFacility and the other one named cboMemberName.  When the user click a command button on the form I have this code in the onclick event.  But when I click it I get a type mismatch error.

    If Len(Trim(Me.cboFacility)) > 0 Then strWhereCondition = strWhereCondition & "([Facility].[FacilityID] IN (" & Me.cboFacility & ")) AND "
    If Len(Trim(Me.cboMemberName)) > 0 Then strWhereCondition = strWhereCondition & "([Member Table].[MemberID] IN (" & Me.cboMemberName & "))"
    If Right(strWhereCondition, 5) = " AND " Then strWhereCondition = Left(strWhereCondition, Len(strWhereCondition) - 5)
    
    DoCmd.OpenReport "rptClinicalNoteReport", acViewPreview, , "", strWhereCondition, acNormal

Open in new window


Can anyone offer a solution?
0
Comment
Question by:SteveL13
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
Comment Utility
Your off by an argument:

DoCmd.OpenReport "rptClinicalNoteReport", acViewPreview, , strWhereCondition, acNormal

Jim.
0
 

Author Closing Comment

by:SteveL13
Comment Utility
Perfect!!!  Thank you Jim.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 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

7 Experts available now in Live!

Get 1:1 Help Now