End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim sql As String, rtn As Long
Select Case Button.Index
Case 1
Frm_zdxz.Caption = "图书征订添加"
Frm_zdxz.Show 1
Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
Case 2
With Frm_zdxz
.Caption = "图书征订修改"
.Txt_zdbh.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 0)
.Txt_tsid.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 1)
.Txt_dgname.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 2)
.Txt_lxfs.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 3)
.Txt_dgsl.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 4)
.Txt_dgdj.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 5)
.Dtpk_dgrq.Value = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 6)
.Cmb_sfys.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 7)
.Dtpk_ysrq.Value = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 8)
.Cmb_czy.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 9)
.Txt_bz.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 10)
.Show 1
End With
Case 3
If MsgBox("确定要删除吗?", vbYesNo + vbQuestion, "提示") = vbYes Then
sql = "delete from 图书征订 where 征订编号='" _
+ Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 0) + "'"
rtn = Update(sql)
If rtn = 0 Then
sql = "select * from 图书征订"
ShowData sql, Me.MSFlexGrid1
MsgBox "删除成功!", vbOKOnly + vbInformation, "提示"
Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>