H
harrykp via AccessMonster.com
And I am using this search code to display the search results in the subform:
Private Sub Search_Click()
Const cInvalidDateError As String = "You have entered an invalid date."
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If status
If Nz(Me.status) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "writing_project.status = '" & Me.
status & "'"
End If
' If class
If Nz(Me.class) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "writing_project.class = '" & Me.
class & "'"
End If
If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "frm_edit_records_datasheet_subform", acFormDS, ,
strWhere, acFormEdit, acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
End If
Me.frm_edit_records_datasheet_subform.Form.Filter = strWhere
Me.frm_edit_records_datasheet_subform.Form.FilterOn = True
End If
End Sub
I need the export the search results in the subform to an excel spreadsheet.
Any ideas will be very much appreciated. Thanks
Private Sub Search_Click()
Const cInvalidDateError As String = "You have entered an invalid date."
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If status
If Nz(Me.status) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "writing_project.status = '" & Me.
status & "'"
End If
' If class
If Nz(Me.class) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "writing_project.class = '" & Me.
class & "'"
End If
If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "frm_edit_records_datasheet_subform", acFormDS, ,
strWhere, acFormEdit, acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
End If
Me.frm_edit_records_datasheet_subform.Form.Filter = strWhere
Me.frm_edit_records_datasheet_subform.Form.FilterOn = True
End If
End Sub
I need the export the search results in the subform to an excel spreadsheet.
Any ideas will be very much appreciated. Thanks