Private Sub Command1_Click()
If Option1.Value = True Then
Adodc1.RecordSource = "select 经手人,sum(订单总金额)as 订单总金额 ,format(订单时间,'yyyy-mm') as 订单时间 from A_xsjl " _
& " where format(订单时间,'yyyy-mm')= '2015-'+'" _
+ Trim(Text1.Text) + "'group by 经手人,format(订单时间,'yyyy-mm')"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Else
If Option2.Value = True Then
Adodc1.RecordSource = "select 商品名称,sum(数量)as 合计销售数量 from A_xsjl group by 商品名称 order by 2 desc"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
End If
End Sub