N
nicolascaprais
Hello, the code below allows me to open on a separate form one entry of
a table with the use of cascading filters.
Private Sub Commande31_Click()DoCmd.OpenReport "rptCordisDetails", A_PREVIEWDim strSQL2 As StringDim intCounter As Integer 'Build SQL String For intCounter = 1 To 2 If Me("Filter" & intCounter) <> "" Then strSQL2 = strSQL2 & "[" & Me("Filter" & intCounter).Tag & "] " & " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And " Else End If Next 'special provision for reliability If Me("Filter" & intCounter) <> "" Then strSQL2 = strSQL2 & "[" & Me("Filter" & intCounter).Tag & "] " & Me("Filter" & intCounter) & " And " End If If strSQL2 <> "" Then 'Strip Last " And " strSQL2 = left(strSQL2, (Len(strSQL2) - 5)) 'Set the Filter property Reports![rptCordisDetails].Filter = strSQL2 Reports![rptCordisDetails].FilterOn = True Else Reports![rptCordisDetails].FilterOn = False End IfEnd Sub
How could I have a similar code to this one, which would export the same
result to a word document, instead of opening it in a report like above?
Thanks
nico
a table with the use of cascading filters.
Private Sub Commande31_Click()DoCmd.OpenReport "rptCordisDetails", A_PREVIEWDim strSQL2 As StringDim intCounter As Integer 'Build SQL String For intCounter = 1 To 2 If Me("Filter" & intCounter) <> "" Then strSQL2 = strSQL2 & "[" & Me("Filter" & intCounter).Tag & "] " & " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And " Else End If Next 'special provision for reliability If Me("Filter" & intCounter) <> "" Then strSQL2 = strSQL2 & "[" & Me("Filter" & intCounter).Tag & "] " & Me("Filter" & intCounter) & " And " End If If strSQL2 <> "" Then 'Strip Last " And " strSQL2 = left(strSQL2, (Len(strSQL2) - 5)) 'Set the Filter property Reports![rptCordisDetails].Filter = strSQL2 Reports![rptCordisDetails].FilterOn = True Else Reports![rptCordisDetails].FilterOn = False End IfEnd Sub
How could I have a similar code to this one, which would export the same
result to a word document, instead of opening it in a report like above?
Thanks
nico