Avatar of SteveL13
SteveL13
Flag 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?
Microsoft Access

Avatar of undefined
Last Comment
SteveL13

8/22/2022 - Mon