⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 一套简单的销售管理系统
💻 FRM
📖 第 1 页 / 共 5 页
字号:
   .ExtendLastCol = True
   .Appearance = Flat
   .FixedRowColStyle = Flat
   .ScrollBarStyle = Flat
   .DefaultFont.Name = "Tahoma"
   .DefaultFont.SIZE = 8
   .BackColorFixed = RGB(100, 98, 160) 'RGB(84, 201, 134)
   .BackColorFixedSel = RGB(100, 98, 160) ' RGB(84, 201, 134)
   .BackColorBkg = RGB(100, 98, 160) 'RGB(198, 229, 211)
   .BackColorScrollBar = RGB(198, 229, 211)
   .BackColor1 = RGB(231, 235, 247)
   .BackColor2 = RGB(198, 229, 211)
   .GridColor = RGB(148, 190, 231)
   .Column(0).Width = 0
End With
With Grid3
   .AllowUserResizing = True
   .DisplayFocusRect = False
   .ExtendLastCol = True
   .Appearance = Flat
   .FixedRowColStyle = Flat
   .ScrollBarStyle = Flat
   .AllowUserResizing = True
   .DisplayFocusRect = False
   .ExtendLastCol = True
   .Appearance = Flat
   .FixedRowColStyle = Flat
   .ScrollBarStyle = Flat
   .DefaultFont.Name = "Tahoma"
   .DefaultFont.SIZE = 8
   .BackColorFixed = RGB(100, 98, 160) 'RGB(84, 201, 134)
   .BackColorFixedSel = RGB(100, 98, 160) 'RGB(84, 201, 134)
   .BackColorBkg = RGB(198, 229, 211)
   .BackColorScrollBar = RGB(198, 229, 211)
   .BackColor1 = RGB(231, 235, 247)
   .BackColor2 = RGB(198, 229, 211)
   .GridColor = RGB(148, 190, 231)
    .Column(0).Width = 0
    .Column(1).Width = 110
    .Column(2).Width = 130
    .Column(3).Width = 80
    .Column(4).Width = 110
    .Column(5).Width = 80
    .Cell(0, 1).Text = "单号"
    .Cell(0, 2).Text = "单位"
    .Cell(0, 3).Text = "日期"
    .Cell(0, 4).Text = "批号"
    .Cell(0, 5).Text = "总金额"
    .Cell(0, 6).Text = "制单人"
    .Column(2).CellType = cellComboBox
    .Column(3).CellType = cellCalendar
    For i = 1 To 5
    .Cell(1, i).ForeColor = RGB(0, 0, 0)
    Next
    .Column(1).Locked = True
    .Column(4).Locked = True
    .Column(5).Locked = True
    .Column(6).Locked = True
End With
je = 3
Dim fr As Integer
Fre1.BackColor = RGB(168, 217, 189)
For fr = 0 To 3
Fre2(fr).Visible = False
Fre2(fr).BackColor = RGB(176, 183, 194) 'RGB(168, 217, 189)
Next
Grid2.Visible = False
Call c1_Click(0)
End Sub

Private Sub Grid2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
If gridsave = True Then
  tjsave.Enabled = True
Else
  tjsave.Enabled = False
End If
If gridedit = True Then
  tjedit.Enabled = True
Else
  tjedit.Enabled = False
End If
If griddelete = True Then
  tjdelete.Enabled = True
Else
  tjdelete.Enabled = False
End If
PopupMenu ZT
End If
End Sub

Private Sub Grid2_RowColChange(ByVal Row As Long, ByVal Col As Long)
On Error GoTo tkFinish
hang2 = Row
For i = 1 To Grid2.Rows - 1
If Grid2.Cell(i, 4).Text <> "" And Grid2.Cell(i, 6).Text <> "" And Grid2.Cell(i, 1).Text <> "" Then
Grid2.Cell(i, 7).Text = Grid2.Cell(i, 4).Text * Grid2.Cell(i, 6).Text
End If
Next
Dim znum As Double
For i = 1 To Grid2.Rows - 1
 If Grid2.Cell(i, 7).Text <> "" And Grid2.Cell(i, 1).Text <> "" Then
 znum = znum + Val(Grid2.Cell(i, 7).Text)
 End If
Next
Grid3.Cell(1, 5).Text = znum
Exit Sub
tkFinish:
MsgBox Err.Description
End Sub

Private Sub Grid2_Validate(Cancel As Boolean)
    Dim nActiveRow As Long, nActiveCol As Long
    Const VK_TAB = 9

    If GetKeyState(VK_TAB) < 0 Then
        nActiveRow = Grid1.ActiveCell.Row
        nActiveCol = Grid1.ActiveCell.Col
        If nActiveCol < Grid1.Cols - 1 Then
            Grid1.Range(nActiveRow, nActiveCol + 1, _
                        nActiveRow, nActiveCol + 1).Selected
        End If
        Cancel = True
    End If
End Sub

Private Sub Image1_Click()
Dim fo2 As CTranslucentForm
Set fo2 = New CTranslucentForm
fo2.hwnd = Form2.hwnd
fo2.Alpha = 85 / 100 * 255
duixiang = 1
Load Form2
Form2.Show 1
End Sub

Private Sub Image2_Click(Index As Integer)
Dim fo2 As CTranslucentForm
Set fo2 = New CTranslucentForm
fo2.hwnd = Form2.hwnd
fo2.Alpha = 85 / 100 * 255
duixiang = 2
Load Form2
Form2.Show 1
End Sub

Private Sub Image3_Click(Index As Integer)
If Frame7.Visible = True Then
Frame7.Visible = False
Exit Sub
End If
Frame7.Visible = True
Frame7.BackColor = RGB(84, 201, 134)
Text4.BackColor = Frame7.BackColor
Text4.SetFocus
XPButton11.Default = True
End Sub

Private Sub renovate_Click()
Call asPopup1_Click(False)
End Sub

Private Sub returncg_Click()
Grid1.Visible = True
Grid2.Visible = False
End Sub

Private Sub savestudent_Click()
Call XPButton5_Click
End Sub

Private Sub Timer1_Timer()
If isadmin = False Then
asPopup1.Enabled = False
c1(2).Enabled = False
XPButton4.Enabled = False
XPButton5.Enabled = False
XPButton6.Enabled = False
Image1.Enabled = False
Image2(2).Enabled = False
Image3(2).Enabled = False
Else
asPopup1.Enabled = True
c1(2).Enabled = True
XPButton4.Enabled = True
XPButton5.Enabled = True
XPButton6.Enabled = True
Image1.Enabled = True
Image2(2).Enabled = True
Image3(2).Enabled = True
End If
End Sub

Private Sub tjdelete_Click()
Call XPButton6_Click
End Sub

Private Sub tjedit_Click()
Call XPButton4_Click
End Sub

Private Sub tjsave_Click()
Call XPButton5_Click
End Sub

Private Sub XPButton1_Click()
If numpage > 1 Then
numpage = numpage - 1
qy1.AbsolutePage = numpage
Grid1.Rows = 1
Grid1.Rows = 11
For i = 1 To 10 '设定读取行
 For j = 1 To jnumber - 2 '设定读取列
 If qy1.Fields(j) = Null Then '空值的处理
 Grid1.Cell(i, j).Text = ""
 Else
 Grid1.Cell(i, j).Text = qy1.Fields(j)
 End If
 Next
 qy1.MoveNext  '读取上一记录
 Next
End If
Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
End Sub

Private Sub XPButton11_Click()
If Text4.Text = "" Then
Exit Sub
End If
Set qy3 = cnn.Execute("select * from 商品单位 where 商品单位='" & Text4.Text & "'")
If qy3.EOF = True Then
Set qy3 = cnn.Execute("insert into 商品单位 values('" & Text4.Text & "')")
MsgBox "添加商品单位成功!", vbInformation, "添加成功"
Else
MsgBox "添加重复!", vbInformation, "添加错误"
End If
End Sub

Private Sub XPButton12_Click()
Frame7.Visible = False
End Sub

Private Sub XPButton13_Click()
If numpage > 1 Then
numpage = 1
qy1.AbsolutePage = numpage
Grid1.Rows = 1
Grid1.Rows = 11
For i = 1 To 10 '设定读取行
 For j = 1 To jnumber - 2 '设定读取列
 If qy1.Fields(j) = Null Then '空值的处理
 Grid1.Cell(i, j).Text = ""
 Else
 Grid1.Cell(i, j).Text = qy1.Fields(j)
 End If
 Next
 qy1.MoveNext  '读取上一记录
 Next
End If
Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
End Sub

Private Sub XPButton14_Click()
If numpage < nnum Then
numpage = nnum
qy1.AbsolutePage = numpage
Grid1.Rows = 1
Grid1.Rows = 11
For i = 1 To 10 '设定读取行
 For j = 1 To jnumber - 2 '设定读取列
 If qy1.EOF = True Then
  Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
 Exit Sub
 End If
 If qy1.Fields(j) = Null Then '空值的处理
 Grid1.Cell(i, j).Text = ""
 Else
 Grid1.Cell(i, j).Text = qy1.Fields(j)
 End If
 Next
 If qy1.EOF = False Then
 qy1.MoveNext  '读取下一记录
 Else
 Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
 Exit Sub
 End If
 Next
Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
End If
End Sub

Private Sub XPButton2_Click()
If numpage < nnum Then
numpage = numpage + 1
qy1.AbsolutePage = numpage
Grid1.Rows = 1
Grid1.Rows = 11
For i = 1 To 10 '设定读取行
 For j = 1 To jnumber - 2 '设定读取列
 If qy1.EOF = True Then
  Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
 Exit Sub
 End If
 If qy1.Fields(j) = Null Then '空值的处理
 Grid1.Cell(i, j).Text = ""
 Else
 Grid1.Cell(i, j).Text = qy1.Fields(j)
 End If
 Next
 If qy1.EOF = False Then
 qy1.MoveNext  '读取下一记录
 Else
 Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
 Exit Sub
 End If
 Next
Label1.Caption = "共" & nnum & "页 第" & numpage & "页"
End If
End Sub

Private Sub XPButton3_Click()
XPFrame2.Visible = False
End Sub

Private Sub XPButton4_Click()
MsgBox "您使用的星零网络未授权作品,需购买论文和源码请联系QQ:342483870"
End Sub

Private Sub XPButton5_Click()
MsgBox "您使用的星零网络未授权作品,需购买论文和源码请联系QQ:342483870"
End Sub

Private Sub XPButton6_Click()
MsgBox "您使用的星零网络未授权作品,需购买论文和源码请联系QQ:342483870"
End Sub

Private Sub XPButton7_Click()
On Error GoTo tkFinish
If FCombo1.Text <> "" And Text1.Text <> "" And Text2.Text <> "" Then
jsql = "select sum(总金额) from 销售单据 where 单位='" & FCombo1.Text & "' and 日期>'" & Text1.Text & "' and 日期<'" & Text2.Text & "'"
Set qy3 = cnn.Execute(jsql)
MsgBox "您所查询的总金额为" & qy3.Fields(0)
End If
Exit Sub
tkFinish:
MsgBox Err.Description
End Sub

Private Sub XPButton8_Click()
On Error GoTo tkFinish
If FCombo2.Text <> "" And Text3.Text <> "" And Text5.Text <> "" Then
gridsave = False
yuzhi = False
Grid1.Cell(0, 0).SetFocus '防止数据被覆盖
If XPCheckBox1.Value <> xcksChecked Then
jsql = "select * from 销售单据 where 单位='" & FCombo2.Text & "' and 日期>'" & Text3.Text & "' and 日期<'" & Text5.Text & "' order by 序号 desc"
Else
jsql = "select 销售单据.* from 销售单据,销售记录 where 销售单据.单位='" & FCombo2.Text & "' and 销售单据.日期>'" & Text3.Text & "' and 销售单据.日期<'" & Text5.Text & "' and 销售单据.批号=销售记录.批号 and 销售记录.商品名称='" & Text6.Text & "' order by 销售单据.序号 desc"
End If
sellnote
gridsave = False
griddelete = True
gridedit = True
XPFrame3.Visible = False
End If
Exit Sub
tkFinish:
MsgBox Err.Description
End Sub

Private Sub XPButton9_Click()
XPFrame3.Visible = False
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -