niki
axes noob 'll b big 1 day
- Local time
- Today, 16:53
- Joined
- Apr 17, 2003
- Messages
- 66
Pease HELP!!! export to Word problem
Hello, the code below allows me to open on a separate form one entry of a table with the use of cascading filters.
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
Hello, the code below allows me to open on a separate form one entry of a table with the use of cascading filters.
Code:
Private Sub Commande31_Click()
DoCmd.OpenReport "rptCordisDetails", A_PREVIEW
Dim strSQL2 As String
Dim 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 If
End 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
Last edited: