Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Open Args for report

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?
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SteveL13

ASKER

Perfect!!!  Thank you Jim.