OutputTo

Y

Yves

Hi,

I wrote this code to export data to Excel:

Public StWherePublic As string

Dim strWhere As String
Dim stDocName As String

StWherePublic = "[Date] Between " & _
Format(Me.txtStart, "\#yyyy\/m\/d\#") & " And " & _
Format(Me.txtend, "\#yyyy\/m\/d\#")


stDocName = "S1_P1"
DoCmd.OutputTo acReport, stDocName, , , True

In the Open Event of the Report, I wrote this code:
If StWherePublic <> vbNullString Then
Me.Filter = StWherePublic
Me.FilterOn = True
StWherePublic = vbNullString
End If

I get the file completed in Excel but the problem that I have is that the on
Open Event does not get called. So my data in Excel does not reflect the
dates that the operator put ( the Filter is not working)

Please someone help me.

Thanks,
Yves
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top