以下是引用片段:
其代码实现如下: Private Sub btn添加_Click() '判断信息的正确性 '更新商品类别表中的信息记录 '1 If Trim(Me.Text3.Text) = "" Then MsgBox "类别名称不能为空!" Exit Sub End If If ExecSql("select * from splb where lbid <>'" & Trim(Me.Text2.Text) & "' and lbmc='" & Trim(Me.Text3.Text) & "'").RecordCount > 0 Then MsgBox "类别名称不能重复!" Exit Sub End If '2 Dim strResult As String strResult = Exec_SqL("update splb set lbmc= '" & Trim(Me.Text3.Text) & "' where lbid='" & Me.Text2.Text & "'") If strResult <> "OK" Then MsgBox strResult End If frmSpxx.UserControl12_Click Unload Me End Sub
Private Sub Form_Activate() '得到商品类表表中最大的类别编号 If Me.Text2.Tag = "" Then Me.Text2.Text = Format(GetMaxNum("select max(lbid) from splb"), "000000") End If End Sub
Private Sub Form_Resize() '动态改变窗体的样式和标题 Call FormFace(Me, TopPicture, KKShape) Call TopCaption(Me.TopPicture, Label2.Caption) End Sub
Private Sub TopPicture_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) '准备窗体移动标志 intOldX = x intOldy = y boolMouseFlag = True End Sub
Private Sub TopPicture_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) '存储窗提议动前的left,top Dim intLeft, intTop As Integer intLeft = Me.Left intTop = Me.Top If Me.WindowState = 2 Then Exit Sub If boolMouseFlag = True Then Me.Left = intLeft + (x - intOldX) Me.Top = intTop + (y - intOldy) End If End Sub
Private Sub TopPicture_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) '还原当前的窗体移动标志 boolMouseFlag = False End Sub
Private Sub UserControl11_Click() '关闭窗体 Unload Me End Sub
|