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

📄 form8.frm

📁 一个简单的公司进销存管理系统
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc6 
      Height          =   375
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1560
      _ExtentX        =   2752
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc7 
      Height          =   375
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1560
      _ExtentX        =   2752
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label8 
      Caption         =   $"Form8.frx":0000
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   2295
      Left            =   360
      TabIndex        =   30
      Top             =   8520
      Width           =   5895
   End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim A As String
Dim B As String
Dim c As String
Dim D As String
A = Text1 + "%"
B = Text2 + "%"
c = Text4 + "%"
D = Text5 + "%"
Adodc2.RecordSource = "select gg from jhmx where cpmc like'" & A & "' and gg <>''and gg<>'*'and gg like'" & B & "' and cj like'" & c & "' and ys like'" & D & "' group by gg"
Adodc2.Refresh

Set DataGrid2.DataSource = Adodc2
Set Text12.DataSource = Adodc2
Text12.DataField = "gg"
DataGrid2.Visible = True
End Sub

Private Sub Command2_Click()
Dim A As String
Dim B As String
Dim c As String
Dim D As String
A = Text1 + "%"
B = Text2 + "%"
c = Text4 + "%"
D = Text5 + "%"
Adodc3.RecordSource = "select cj from jhmx where cpmc like'" & A & "' and cj<>''and cj<>'*'and gg like'" & B & "' and cj like'" & c & "' and ys like'" & D & "' group by cj"
Adodc3.Refresh

Set DataGrid3.DataSource = Adodc3
Set Text13.DataSource = Adodc3
Text13.DataField = "cj"
DataGrid3.Visible = True
End Sub

Private Sub Command3_Click()
Dim A As String
Dim B As String
Dim c As String
Dim D As String
A = Text1 + "%"
B = Text2 + "%"
c = Text4 + "%"
D = Text5 + "%"
Adodc4.RecordSource = "select ys from jhmx where cpmc like'" & A & "' and ys<>''and ys <>'*' and gg like'" & B & "' and cj like'" & c & "' and ys like'" & D & "' group by ys"
Adodc4.Refresh
Set DataGrid4.DataSource = Adodc4
Set Text14.DataSource = Adodc4
Text14.DataField = "ys"
DataGrid4.Visible = True
End Sub

Private Sub Command4_Click()
Dim A As String
Dim B As String
Dim c As String
Dim D As String
A = Text1 + "%"
B = Text2 + "%"
c = Text4 + "%"
D = Text5 + "%"
Adodc1.RecordSource = "select cpmc from jhmx where cpmc like'" & A & "' and cpmc<>''and gg like'" & B & "' and cj like'" & c & "' and ys like'" & D & "' group by cpmc "
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set Text10.DataSource = Adodc1
Text10.DataField = "cpmc"
DataGrid1.Visible = True
End Sub

Private Sub Command5_Click()
If Text1 = "" Then
MsgBox "请选择或输入货物名称!", vbExclamation, "系统提示您"
GoTo 1
End If
If Text3 = "" Then
MsgBox "请输入退货数量!", vbExclamation, "系统提示您"
GoTo 1
End If
If Text6 = "" Then
Adodc6.RecordSource = "select cbj,max(jhsj) as jhsj from jhmx where cpmc like'" & Text1.Text & "'and gg like'" & Text2.Text & "' and cj like'" & Text4.Text & "' and ys like'" & Text5.Text & "'group by cbj"
Adodc6.Refresh
If Adodc6.Recordset.BOF = True And Adodc6.Recordset.EOF = True Then
MsgBox "没有找到该产品,请核实!", vbExclamation, "系统提示您"
GoTo 1
End If
Set Text15.DataSource = Adodc6
Text15.DataField = "cbj"
Text6 = Text15
End If
Text8 = Date + Time
Text9 = "0"
Adodc5.Recordset.Update
Adodc5.Refresh
Adodc5.Recordset.AddNew
Text10 = ""
Text12 = ""
Text13 = ""
Text14 = ""
1 End Sub

Private Sub Command6_Click()
Unload Form8
End Sub

Private Sub DataGrid1_Click()
DataGrid1.Visible = False
End Sub

Private Sub DataGrid1_LostFocus()
DataGrid1.Visible = False
End Sub

Private Sub DataGrid2_Click()
DataGrid2.Visible = False
End Sub

Private Sub DataGrid2_LostFocus()
DataGrid2.Visible = False
End Sub

Private Sub DataGrid3_Click()
DataGrid3.Visible = False
End Sub

Private Sub DataGrid3_LostFocus()
DataGrid3.Visible = False
End Sub

Private Sub DataGrid4_Click()
DataGrid4.Visible = False
End Sub

Private Sub DataGrid4_LostFocus()
DataGrid4.Visible = False
End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc7.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc2.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc3.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc4.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc6.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc5.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc5.RecordSource = "select * from jhmx "
Adodc5.Refresh
Set Text1.DataSource = Adodc5
Text1.DataField = "cpmc"
Set Text2.DataSource = Adodc5
Text2.DataField = "gg"
Set Text3.DataSource = Adodc5
Text3.DataField = "sl"
Set Text4.DataSource = Adodc5
Text4.DataField = "cj"
Set Text5.DataSource = Adodc5
Text5.DataField = "ys"
Set Text6.DataSource = Adodc5
Text6.DataField = "cbj"
Set Text7.DataSource = Adodc5
Text7.DataField = "bz"
Set Text8.DataSource = Adodc5
Text8.DataField = "thsj"
Set Text9.DataSource = Adodc5
Text9.DataField = "JTXHBS"
Adodc5.Recordset.AddNew
End Sub

Private Sub Text1_Change()
Text16 = "%" + Text1 + "%"
End Sub

Private Sub Text1_Click()
DataGrid1.Visible = False
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.RecordSource = "select cpmc from jhmx where cpmc like'" & Text11.Text & "' and cpmc<>''group by cpmc"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set Text10.DataSource = Adodc1
Text10.DataField = "cpmc"
DataGrid1.Visible = True
End If
End Sub

Private Sub Text10_Change()
Text1 = Trim(Text10)
End Sub

Private Sub Text12_Change()
Text2 = Text12
End Sub

Private Sub Text13_Change()
Text4 = Text13
End Sub

Private Sub Text14_Change()
Text5 = Text14
End Sub

Private Sub Text2_Change()
Text17 = "%" + Text2 + "%"
End Sub

Private Sub Text2_Click()
DataGrid2.Visible = False
End Sub



Private Sub Text3_Click()
Dim c As String
Dim A As Integer
Dim B As Integer
Adodc7.RecordSource = "select sum(sl)as sl from jhmx where cpmc like'" & Text16 & "' and gg like'" & Text17 & "' and cj like'" & Text18 & "' and ys like'" & Text19 & "'and jtxhbs='1'"
Adodc7.Refresh
If Adodc7.Recordset.BOF = True And Adodc7.Recordset.EOF = True Then
A = 0
Else
Set Label9.DataSource = Adodc7
Label9.DataField = "sl"
A = Label9
End If
Adodc7.RecordSource = "select sum(sl)as sl from jhmx where cpmc like'" & Text16 & "' and gg like'" & Text17 & "' and cj like'" & Text18 & "' and ys like'" & Text19 & "'and jtxhbs='0'"
Adodc7.Refresh
If Adodc7.Recordset.BOF = True And Adodc7.Recordset.EOF = True Then
B = 0
Else
Set Label9.DataSource = Adodc7
Label9.DataField = "sl"
B = Label9
End If
Text20 = A - B
c = "该产品目前库存为:" + Text20 + ",请核实!"
MsgBox c, vbExclamation, "系统提示您"




End Sub

Private Sub Text4_Change()
Text18 = "%" + Text4 + "%"
End Sub

Private Sub Text4_Click()
DataGrid3.Visible = False
End Sub

Private Sub Text5_Change()
Text19 = "%" + Text5 + "%"
End Sub

Private Sub Text5_Click()
DataGrid4.Visible = False
End Sub

⌨️ 快捷键说明

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