Private Sub Check1_Click()
If Check1.Value = 1 Then                                  '判断复选框是否被选择重
    DTPicker1.Enabled = True                              '设置日期起是否可以设置
    DTPicker2.Enabled = True
Else
    DTPicker1.Enabled = False
    DTPicker2.Enabled = False
 End If
End SubPrivate Sub Command1_Click()
    MSHFlexGrid1.Clear
    If Check1.Value = 1 Then
     Adodc1.RecordSource = "shape{select 开工日期,工程地点,工程类型,工程天数,原路数,增加路数,是否完工,工程资金,备注,编号 from 工程日志库 where 工程日志库.开工日期 BETWEEN #" & DTPicker1.Value & "# and #" & DTPicker2.Value & "#}as 工程日志库 append({select 工程日期,工程人员,工程主管,后勤主管,工程车辆,工程情况,链接号 from 工程日志库子表}as 工程日志库子表 relate 编号 to 链接号)as 工程日志库子表2"  '以查讯方式打开数据库
     Adodc1.Refresh
      Set MSHFlexGrid1.DataSource = Adodc1
     MSHFlexGrid1.CollapseAll (0)
     MSHFlexGrid1.Refresh
  
 End If
End SubPrivate Sub Command3_Click()
Adodc1.Recordset.Close                                      '关闭密码数据库记录
Unload Formjs                                               '退出登陆窗口
End SubPrivate Sub Form_Load()
Formjs.Caption = "友邦公司工程日志检索"                      '置浏览窗体的属性
Formjs.Height = Screen.Height * 0.85
Formjs.Width = Screen.Width - 600
Formjs.Top = 0
Formjs.Left = (MDIFormwoker.Width - Formjs.Width) / 2        '置formck窗口在屏幕中的位置MSHFlexGrid1.Height = Formjs.Height * 0.6                    '置网格控件的高度和宽度
MSHFlexGrid1.Width = Formjs.Width - 500
MSHFlexGrid1.Left = (Formjs.Width - MSHFlexGrid1.Width) / 2  '置网格控件在屏幕中的位置
MSHFlexGrid1.Top = Formjs.Height * 0.3Command1.Top = 300                                   '设置命令按钮1的属性
Command1.Left = MSHFlexGrid1.Width * 0.9
Command1.Caption = "检索"
Command1.Width = 1200
Command1.Height = 380Command2.Top = Command1.Top + 800                   '设置命令按钮2的属性
Command2.Left = MSHFlexGrid1.Width * 0.9
Command2.Caption = "取消"
Command2.Width = 1200
Command2.Height = 380Command3.Top = Command2.Top + 800                   '设置命令按钮2的属性
Command3.Left = MSHFlexGrid1.Width * 0.9
Command3.Caption = "退出"
Command3.Width = 1200
Command3.Height = 380Check1.Caption = "开工日期"                         '设置复选框1的属性
Check1.Height = 380
Check1.Top = 140
Check1.Left = MSHFlexGrid1.Left
DTPicker1.Height = 380                              '设置日期选择控件1属性
DTPicker1.Width = 1500
DTPicker1.Top = 100
DTPicker1.Left = Check1.Left + 1200
DTPicker1.Enabled = False
Label1.Caption = "至"                              '设置日期标签控件1属性
Label1.Width = 300
Label1.Height = 380
Label1.Top = 160
Label1.Left = DTPicker1.Left + 1700DTPicker2.Height = 380                             '设置日期选择控件1属性
DTPicker2.Width = 1500
DTPicker2.Top = 100
DTPicker2.Left = Label1.Left + 400
DTPicker2.Enabled = False
Adodc1.ConnectionString = "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\ZQL\VB\数据库\1997版本\工程日志数据库.mdb;Persist Security Info=False"       '以形状的方式打开二个数据表,并把他们关联起来
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "shape{select 开工日期,工程地点,工程类型,工程天数,原路数,增加路数,是否完工,工程资金,备注,编号 from 工程日志库 where 工程日志库.开工日期=0}as 工程日志库 append({select 工程日期,工程人员,工程主管,后勤主管,工程车辆,工程情况,链接号 from 工程日志库子表}as 工程日志库子表 relate 编号 to 链接号)as 工程日志库子表1"  '以无记录方式打开数据库
Adodc1.Refresh
Adodc1.Visible = False                                   '使data1控件不可见
Set MSHFlexGrid1.DataSource = Adodc1
MSHFlexGrid1.CollapseAll (0)                             '折叠子带区
MSHFlexGrid1.AllowUserResizing = flexResizeColumns     '可以调整行宽
MSHFlexGrid1.RowHeightMin = 360                        '设置最小行高
MSHFlexGrid1.Cols = 10                                 '设置总列数
MSHFlexGrid1.ColWidth(0) = 500                         '设置每列的宽度
MSHFlexGrid1.ColWidth(1) = 900
MSHFlexGrid1.ColWidth(2) = 3000
MSHFlexGrid1.ColWidth(3) = 900
MSHFlexGrid1.ColWidth(4) = 900
MSHFlexGrid1.ColWidth(5) = 900
MSHFlexGrid1.ColWidth(6) = 900
MSHFlexGrid1.ColWidth(7) = 900
MSHFlexGrid1.ColWidth(8) = 900
MSHFlexGrid1.ColWidth(9) = 3000
MSHFlexGrid1.ColWidth(10) = 0
MSHFlexGrid1.BandDisplay = flexBandDisplayVertical    '设置带区以垂直的方式显示
MSHFlexGrid1.ColHeader(1) = flexColHeaderOn           '设置显示第二个带区的表头End Sub
为什么我这个选择择日期后显示出来的数据是正确的,但是他前面的小加号本行不能先重展开,只有在下一行才能展开上一行的,感觉显示混乱了一样