📄 frmuserinfomanage2.frm
字号:
VERSION 5.00
Begin VB.Form frmBuyerInfomanage
Caption = "买方信息管理"
ClientHeight = 5415
ClientLeft = 60
ClientTop = 450
ClientWidth = 6480
LinkTopic = "Form1"
ScaleHeight = 5415
ScaleWidth = 6480
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Txtbuyname
Height = 495
Left = 1680
TabIndex = 22
Top = 240
Width = 1575
End
Begin VB.CommandButton CmdDelete
Caption = "删除"
Height = 495
Left = 2160
TabIndex = 21
Top = 4200
Width = 975
End
Begin VB.CommandButton CmdAdd
Caption = "增加"
Height = 495
Left = 960
TabIndex = 20
Top = 4200
Width = 975
End
Begin VB.CommandButton CmdBuyQuery
Caption = "查询"
Height = 495
Left = 4320
TabIndex = 19
Top = 240
Width = 1215
End
Begin VB.CommandButton CmdCancel
Caption = "取消"
Height = 495
Left = 4560
TabIndex = 18
Top = 4200
Width = 975
End
Begin VB.CommandButton CmdChange
Caption = "修改"
Height = 495
Left = 3360
TabIndex = 17
Top = 4200
Width = 975
End
Begin VB.Frame Frame2
Caption = "信息管理"
Height = 2775
Left = 120
TabIndex = 0
Top = 1080
Width = 6015
Begin VB.TextBox TxtbuyIDBM
Height = 375
Left = 960
TabIndex = 23
Top = 360
Width = 1215
End
Begin VB.TextBox txtStepBM
Height = 375
Left = 960
TabIndex = 15
Top = 2160
Width = 1215
End
Begin VB.TextBox txtLowPriceBM
Height = 375
Left = 3240
TabIndex = 13
Top = 2160
Width = 2655
End
Begin VB.TextBox txtHighpriceBM
Height = 375
Left = 3240
TabIndex = 11
Top = 1560
Width = 2655
End
Begin VB.TextBox txtQualityBM
Height = 375
Left = 960
TabIndex = 9
Top = 1560
Width = 1215
End
Begin VB.TextBox txtProductionBM
Height = 375
Left = 3240
TabIndex = 7
Top = 960
Width = 2655
End
Begin VB.TextBox TxtcompanyBM
Height = 375
Left = 3240
TabIndex = 5
Top = 360
Width = 2655
End
Begin VB.TextBox txtServeBM
Height = 375
Left = 960
TabIndex = 3
Top = 960
Width = 1215
End
Begin VB.Label Label9
Caption = "让步幅度"
Height = 375
Left = 120
TabIndex = 14
Top = 2160
Width = 735
End
Begin VB.Label Label8
Caption = "最低价格"
Height = 375
Left = 2400
TabIndex = 12
Top = 2160
Width = 735
End
Begin VB.Label Label7
Caption = "最高价格"
Height = 375
Left = 2400
TabIndex = 10
Top = 1560
Width = 735
End
Begin VB.Label Label6
Caption = "质量系数"
Height = 375
Left = 120
TabIndex = 8
Top = 1560
Width = 735
End
Begin VB.Label Label5
Caption = "产品名称"
Height = 375
Left = 2400
TabIndex = 6
Top = 960
Width = 735
End
Begin VB.Label Label4
Caption = "单位名称"
Height = 375
Left = 2400
TabIndex = 4
Top = 360
Width = 735
End
Begin VB.Label Label3
Caption = "服务系数"
Height = 375
Left = 120
TabIndex = 2
Top = 960
Width = 735
End
Begin VB.Label Label2
Caption = "用户名"
Height = 375
Left = 120
TabIndex = 1
Top = 360
Width = 735
End
End
Begin VB.Label Label1
Caption = "请输入用户名"
Height = 495
Left = 360
TabIndex = 16
Top = 240
Width = 1095
End
End
Attribute VB_Name = "frmBuyerInfomanage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdAdd_Click()
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyerinfo "
RS.Open StrSQL, ConnStr, 1, 3
RS.AddNew
RS("username") = TxtbuyIDBM
RS("buyname") = TxtcompanyBM
RS("production") = txtProductionBM
RS("serve") = txtServeBM
RS("lowprice") = txtLowPriceBM
RS("highprice") = txtHighpriceBM
RS("quality") = txtQualityBM
RS("step") = txtStepBM
RS.Update
RS.Close
Set RS = Nothing
MsgBox "此项已添加!", vbOKOnly Or vbInformation
End Sub
Private Sub CmdBuyQuery_Click()
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyerinfo where username = '" & Txtbuyname & "'"
RS.Open StrSQL, ConnStr, 1, 1
If Not RS.EOF Then
TxtbuyIDBM = RS("username")
TxtcompanyBM = RS("buyname")
txtProductionBM = RS("production")
txtServeBM = RS("serve")
txtLowPriceBM = RS("lowprice")
txtHighpriceBM = RS("highprice")
txtQualityBM = RS("quality")
txtStepBM = RS("step")
ElseIf Txtbuyname = "" Then
MsgBox "请输入用户名!", vbOKOnly Or vbInformation, "买方信息管理"
Else
MsgBox "查无此用户名,请添加!", vbOKOnly Or vbInformation, "买方信息管理"
TxtbuyIDBM = ""
TxtcompanyBM = ""
txtProductionBM = ""
txtServeBM = ""
txtLowPriceBM = ""
txtHighpriceBM = ""
txtQualityBM = ""
txtStepBM = ""
RS.Close
Set RS = Nothing
End If
End Sub
Private Sub cmdCancel_Click()
Me.Hide
End Sub
Private Sub CmdChange_Click()
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyerinfo where username = '" & Txtbuyname & "'"
RS.Open StrSQL, ConnStr, 1, 3
If Not RS.EOF Then
RS("username") = TxtbuyIDBM
RS("buyname") = TxtcompanyBM
RS("production") = txtProductionBM
RS("serve") = txtServeBM
RS("lowprice") = txtLowPriceBM
RS("highprice") = txtHighpriceBM
RS("quality") = txtQualityBM
RS("step") = txtStepBM
RS.Update
RS.Close
Set RS = Nothing
MsgBox "此项已修改!", vbOKOnly Or vbInformation
Else
RS.Close
Set RS = Nothing
MsgBox "查无此用户名,请添加!", vbOKOnly Or vbInformation
CmdAdd_Click
End If
End Sub
Private Sub CmdDelete_Click()
If MsgBox("是否删除此买家?", vbYesNo Or vbQuestion) = vbYes Then
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyerinfo where username = '" & TxtbuyIDBM & "'"
RS.Open StrSQL, ConnStr, 1, 3
If RS.EOF Then
MsgBox "查无此项!", vbOKOnly
Else
RS.Delete
TxtbuyIDBM = ""
TxtcompanyBM = ""
txtProductionBM = ""
txtServeBM = ""
txtLowPriceBM = ""
txtHighpriceBM = ""
txtQualityBM = ""
txtStepBM = ""
RS.Update
End If
RS.Close
Set RS = Nothing
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -