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

📄 frm_hggl.frm

📁 采购管理系统使用vb6.0 加sql2000数据库 编程
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Left            =   3840
         Locked          =   -1  'True
         TabIndex        =   14
         Top             =   960
         Width           =   1335
      End
      Begin VB.TextBox Text4 
         DataField       =   "供应商编号"
         DataSource      =   "Adodc1"
         Height          =   270
         Left            =   1320
         Locked          =   -1  'True
         TabIndex        =   13
         Top             =   960
         Width           =   1455
      End
      Begin VB.TextBox Text3 
         DataField       =   "货物名称"
         DataSource      =   "Adodc1"
         Height          =   270
         Left            =   6240
         TabIndex        =   12
         Top             =   600
         Width           =   1215
      End
      Begin VB.TextBox Text2 
         DataField       =   "批号"
         DataSource      =   "Adodc1"
         Height          =   270
         Left            =   3840
         TabIndex        =   11
         Top             =   600
         Width           =   1335
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   330
         Left            =   720
         Top             =   3480
         Width           =   1200
         _ExtentX        =   2117
         _ExtentY        =   582
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   1
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_cggl;Data Source=服务器"
         OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_cggl;Data Source=服务器"
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   "select * from table_dhb"
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin MSAdodcLib.Adodc Adodc2 
         Height          =   330
         Left            =   360
         Top             =   3360
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   582
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   1
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_cggl;Data Source=服务器"
         OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_cggl;Data Source=服务器"
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   "select * from table_hglgl"
         Caption         =   "Adodc2"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin VB.Label Label12 
         Caption         =   "统计编号"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   240
         TabIndex        =   31
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label11 
         Caption         =   "%"
         Height          =   255
         Left            =   4680
         TabIndex        =   29
         Top             =   1320
         Width           =   375
      End
      Begin VB.Label Label10 
         Caption         =   "统计日期"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Index           =   0
         Left            =   5280
         TabIndex        =   10
         Top             =   1320
         Width           =   735
      End
      Begin VB.Label Label9 
         Caption         =   "原因(备注)"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   1800
         Width           =   1095
      End
      Begin VB.Label Label8 
         Caption         =   "不合格率"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   3000
         TabIndex        =   8
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label7 
         Caption         =   "不合格数"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label6 
         Caption         =   "数量"
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   5280
         TabIndex        =   6
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label5 
         Caption         =   "到货日期"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   3000
         TabIndex        =   5
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "供货商编号"
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   120
         TabIndex        =   4
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "货物名称"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   5280
         TabIndex        =   3
         Top             =   600
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "批号"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   3000
         TabIndex        =   2
         Top             =   600
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "到货单号"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   600
         Width           =   975
      End
   End
End
Attribute VB_Name = "frm_hglgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Cmd_refurbish_Click()

End Sub





Private Sub Cmd_del_Click()
Adodc2.RecordSource = "select * from Table_hglgl"
'Adodc1.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
c = MsgBox("确认要删除该信息吗?", 17, "采购管理系统")
If c = vbOK Then
Adodc2.Recordset.Delete
Else
End If
Else
MsgBox "数据库中的信息为空,没有可删除的信息!!", 64, "采购管理系统"
End If
End Sub

Private Sub cmd_edit_Click()
If Val(Text1.Text) <> Adodc2.Recordset.Fields("统计编号") Then MsgBox "统计编号不符合", "33", "采购管理系统"

Call Main
 c = MsgBox("确认要修改该信息吗?", 33, "采购管理系统")
 If c = vbOK Then
 Adodc2.Recordset.Delete
   Set adoRs = adoCon.Execute("insert into table_hglgl values(" & Text1 & ",'" & DataCombo1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & DP1 & "')")
 MsgBox "数据修改成功!!", 64, "采购管理系统"
 cmd_edit.Enabled = False
 Else
 End If
'Adodc2.Refresh
adoCon.Close
End Sub

Private Sub cmd_quer_Click()
Frame2.Visible = False
Frame3.Visible = True
End Sub

Private Sub cmd_refresh_Click()
Unload Me
frm_hglgl.Refresh
frm_hglgl.Show
End Sub

Private Sub Combo1_Change()

End Sub

Private Sub Command1_Click()
If Combo5.Text = "" Or Combo4.Text = "" Or Text12.Text = "" Then
MsgBox "输入或选择的内容不能为空值", 48, "采购管理系统"
ElseIf Combo5.Text = "数量" Or Combo5.Text = "金额" Or Combo5.Text = "货物编号" Then
    If Not IsNumeric(Text12.Text) Then
    Text12.Text = ""
    Text12.SetFocus
    Else
    a = Text12.Text
       If i = 0 Then
       Adodc2.RecordSource = "select * from Table_hglgl where " + Combo5.Text + " " + Combo4.Text + " '" + a + "'"
       Adodc2.Refresh
       ElseIf i = 1 Then
       Adodc2.RecordSource = "select * from Table_hglgl where " + Combo5.Text + " like '%" + a + "%'"
       Adodc2.Refresh
       Else
       End If
    End If
Else
    a = Text12.Text
       If i = 0 Then
       Adodc2.RecordSource = "select * from Table_hglgl where " + Combo5.Text + " " + Combo4.Text + " '" + a + "'"
       Adodc2.Refresh
       ElseIf i = 1 Then
       Adodc2.RecordSource = "select * from Table_hglgl where " + Combo5.Text + " like '%" + a + "%'"
       Adodc2.Refresh
       Else
       End If
End If
End Sub

Private Sub Cmd_exit_Click()
Unload Me
End Sub

Private Sub Cmd_save_Click()
Call Main
Adodc2.RecordSource = "select * from table_hglgl where 统计编号='" + Text1 + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
c = MsgBox("确认要保存该信息吗?", 33, "采购管理系统")
If c = vbOK Then
  Set adoRs = adoCon.Execute("insert into table_hglgl values(" & Text1 & ",'" & DataCombo1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & DP1 & "')")
  MsgBox "数据保存成功!!", 32, "采购管理系统"
  cmd_save.Enabled = False
  cmd_add.Enabled = True
Else
End If
Else
MsgBox "对不起,该信息已经保存过,不能够再进行保存", 64, "采购管理系统"
End If
Adodc2.RecordSource = "select * from table_hglgl order by 统计编号"
Adodc2.Refresh
adoCon.Close


End Sub
Private Sub cmd_add_Click()
Dim temp1
temp1 = Format(Now, "yyyymmdd")
Text7.Text = ""

Adodc2.RecordSource = "select * from Table_hglgl where 统计编号 like '%" + temp1 + "%'order by 统计编号"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveLast
Text1.Text = Adodc2.Recordset.Fields("统计编号")
Text1.Text = Val(Adodc2.Recordset.Fields("统计编号")) + 1
Else
Text1.Text = Format(Now, "yyyymmdd")
Text1.Text = Text1.Text + "0000"
End If
Adodc2.RecordSource = "select * from Table_hglgl order by 统计编号"
Adodc2.Refresh
DataCombo1.SetFocus
cmd_save.Enabled = True
cmd_add.Enabled = False
DataCombo1.Text = ""

End Sub

Private Sub Command2_Click()
Frame3.Visible = False
Frame2.Visible = True
End Sub

Private Sub DataCombo1_Change()

 Adodc1.Recordset.MoveFirst
 If Not IsNull(DataCombo1.SelectedItem) Then Adodc1.Recordset.Move DataCombo1.SelectedItem - 1
'Adodc1.RecordSource = "select * from table_dhb where到货单号='" + DataCombo1.Text + "'"
'Set Text2.DataSource = Adodc1

End Sub

Private Sub DataGrid1_Click()
Adodc2.RecordSource = " select * form table_hglgl where 统计编号='" + Text1 + "'"
'Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Text1.Text = Adodc2.Recordset.Fields("统计编号")
DataCombo1.Text = Adodc2.Recordset.Fields("到货单号")
Text2.Text = Adodc2.Recordset.Fields("批号")
Text3.Text = Adodc2.Recordset.Fields("货物名称")
Text4.Text = Adodc2.Recordset.Fields("供货商编号")
Text5.Text = Adodc2.Recordset.Fields("到货日期")
Text6.Text = Adodc2.Recordset.Fields("数量")
Text7.Text = Adodc2.Recordset.Fields("不合格数")
DP1.Value = Adodc2.Recordset.Fields("统计日期")
Text8.Text = Adodc2.Recordset.Fields("不合格率")
Text9.Text = Adodc2.Recordset.Fields("备注")
Else
End If
If cmd_del.Enabled = False Then cmd_del.Enabled = True
If cmd_edit.Enabled = False Then cmd_edit.Enabled = True


End Sub

Private Sub Form_Load()
Call Main
Adodc1.RecordSource = " select * from table_dhb"
Adodc1.Refresh
Set DataCombo1.DataSource = Adodc1
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Else
End If
adoCon.Close
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
'Text6.Text = ""




End Sub

Private Sub Text7_Change()

Text8.Text = (Val(Text7.Text) / Val(Text6.Text)) * 100
Text8.Text = Format(Val(Text8.Text), "0.00")

If Val(Text8.Text) > 100 Then MsgBox "不合格数量大于货物数量", "33", "采购管理系统"

End Sub

⌨️ 快捷键说明

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