Hi to all,
I have a main form (frmMembersInfo) with a combo box. The user selects a name from the combo box and data is shown on the subform (frmMembersInfoSubForm), The control name of the subform is (cntMembersInfoSubForm).
On the main form I have a button to print the data on the subform for the selected person.
below is the code:
Code:
If Len(Me.[frmMembersInfoSubForm].txtFirstName & "") = 0 Or Len(Me.[frmMembersInfoSubForm].txtFamilyName & "") = 0 Then
MsgBox "Please select a member, " & vbCrLf _
& "before attempting to preview the report." & vbCrLf _
& vbInformation, "Personal Information Needed..."
Exit Sub
Else
If Me.Dirty = True Then 'Save the record
Me.Dirty = False
End If
DoCmd.OpenReport "rptMemberReportInfo", view:=acViewPreview, _
WhereCondition:="[pkMemberId] = " & Me.[frmMembersInfoSubForm].pkMemberId
End If
The If Len(Me.... has an error. I am not able to find it out. Any help is appreciated
Khalil