F
Frank The Novice
Hello Folks,
I have a table that has several events per day, and I want to generate a
report of the events that were done on a specific day.
My problem is Access keeps crashing when I try to open a report with the
following Load event:
Private Sub Report_Load()
DoCmd.ApplyFilter , "DoF = #01/01/2009#"
End Sub
I can get around this by just applying the filter in the report data block.
However, I have a command button that will take me to the first record in the
query. The code I use is:
Private Sub Command19_Click()
Dim TDate As Date
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Sector Record Query")
rst.MoveFirst
TDate = rst![DoF]
DoCmd.ApplyFilter , "DoF = #" & TDate & "#"
rst.Close
End Sub
But every time I click the button, Access shuts down and restarts, but never
tells me what I did wrong.
Any suggestions?
Frank
I have a table that has several events per day, and I want to generate a
report of the events that were done on a specific day.
My problem is Access keeps crashing when I try to open a report with the
following Load event:
Private Sub Report_Load()
DoCmd.ApplyFilter , "DoF = #01/01/2009#"
End Sub
I can get around this by just applying the filter in the report data block.
However, I have a command button that will take me to the first record in the
query. The code I use is:
Private Sub Command19_Click()
Dim TDate As Date
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Sector Record Query")
rst.MoveFirst
TDate = rst![DoF]
DoCmd.ApplyFilter , "DoF = #" & TDate & "#"
rst.Close
End Sub
But every time I click the button, Access shuts down and restarts, but never
tells me what I did wrong.
Any suggestions?
Frank