数据环境 与报表 问题?
xfe1 2002-05-14 02:15:10 在dataenviroment中按 工号分组 在datareport 中检索了结构
'tempbj 为临时表
'bj 为源数据表
Dim rst As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim DataPath As String
DataPath = App.Path & "\choucha1.mdb"
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataPath & ";Mode=ReadWrite;Persist Security Info=False"
Set cmd = New ADODB.Command
cmd.CommandText = "delete from tempbj" '每次查询先清空临时表
cmd.CommandType = adCmdText
Set rst = cmd.Execute
cmd.CommandText = "insert into tempbj select bj.* from bj where 日期>=#" & DTPicker1.Value & "# and 日期<=#" & DTPicker2.Value & "# "
cmd.CommandType = adCmdText '将查询的内容写入空的临时表中
Set rst = cmd.Execute
DataReport1.Show
但是 当执行查询后 报表的内容没有改变 ,tempbj的数据正确 如何才能使报表也能动态改变
我试过 如果没有按工号分组 以下 DataEnvironment1.rsCommand1.Requery 语句 可以实现功能 但是分组后怎样解决呢?
谢谢 各位老兄