📄 frmformat.frm
字号:
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 240
TabIndex = 15
Top = 840
Width = 1035
End
End
Begin VB.CommandButton CmdBack
Caption = "返回"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 0
ToolTipText = "返回上级窗体"
Top = 4560
Width = 1455
End
End
Attribute VB_Name = "FrmFormat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cbxpopedom_Change()
Txtsurepassword.SetFocus
End Sub
Private Sub Cbxpopedom_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then Txtsurepassword.SetFocus
End Sub
Private Sub CmdBack_Click()
Unload Me
FrmMain.Show
End Sub
Private Sub CmdNext1_Click() '用户信息输入的"继续"
Txtuser_name.Text = ""
Txtlogin_id.Text = ""
Txtposition.Text = ""
Txtpassword.Text = ""
Txtsurepassword.Text = ""
Cbxpopedom.Text = ""
CmdOk1.Enabled = True
Txtuser_name.SetFocus
End Sub
Private Sub CmdNext2_Click() '厂家信息输入的"继续"
On Error GoTo Err
Txtfct_name.Text = ""
Txtfct_principal.Text = ""
Txtfct_add.Text = ""
Txtfct_tel.Text = ""
Txtfct_postalcode.Text = ""
CmdOk2.Enabled = True
Txtfct_name.SetFocus
Err:
End Sub
Private Sub CmdNext3_Click()
On Error GoTo Err
Txtpd_kind_name.Text = ""
Txtpd_id.Text = ""
CmdOk3.Enabled = True
Txtpd_id.SetFocus
Err:
End Sub
Private Sub CmdOk1_Click() '用户信息输入的"添加"
On Error GoTo ErrHandle
Dim rd As Recordset
Dim i As Integer
Dim sql As String
Dim popedom_type As Integer
Set rd = gDbFish.OpenRecordset("select * from login_info")
If Txtuser_name.Text = "" Then
MsgBox "您未输入名字,请重输!", vbExclamation, "系统提示"
Exit Sub
End If
If Txtlogin_id.Text = "" Then
MsgBox "您未输入登录名,请重输!", vbExclamation, "系统提示"
Exit Sub
End If
If Txtpassword.Text = "" Then
MsgBox "您未输入密码,请重输!", vbExclamation, "系统提示"
Exit Sub
End If
If Cbxpopedom.Text = "" Then
MsgBox "您未输入职位,请重输!", vbExclamation, "系统提示"
Exit Sub
End If
Do While Not rd.EOF
If Trim(Txtlogin_id.Text) <> Trim(rd.Fields("login_id")) Then
rd.MoveNext
Else
MsgBox "您输入的用户登录名称已存在,请重新填写!建议使用名字的拼音缩写...", vbExclamation, "系统提示"
'Exit Do
Exit Sub
End If
Loop
If Txtpassword.Text <> Txtsurepassword.Text Then
MsgBox "您输入的密码前后不一致,请确认..."
Exit Sub
End If
Select Case Cbxpopedom.Text
Case "管理员级别"
popedom_type = 1
Case "仓库级别"
popedom_type = 2
Case "一般用户"
popedom_type = 3
End Select
sql = "insert into login_info (user_name,login_id,password,position,popedom) values ('" + Trim(Txtuser_name) + "','" + Trim(Txtlogin_id) + "','" + Trim(Txtpassword) + "','" + Trim(Txtposition) + "','" + Trim(popedom_type) + "')"
gDbFish.Execute sql
MsgBox "数据输入成功!", vbDefaultButton1, "系统提示"
CmdOk1.Enabled = False
ErrHandle:
End Sub
Private Sub CmdOk2_Click() '厂家信息输入的"添加"
On Error GoTo ErrHandle
Dim rd As Recordset
Dim i As Integer
Dim sql As String
'Dim fac_type As Integer
Set rd = gDbFish.OpenRecordset("select * from factory_info")
If Txtfct_name.Text = "" Then
MsgBox "您未输入厂家名称,请输入!", vbExclamation, "系统提示"
Exit Sub
End If
Do While Not rd.EOF '表中数据不为空
If Trim(Txtfct_name.Text) <> Trim(rd.Fields("fct_name")) Then
rd.MoveNext
Else
MsgBox "您输入的厂家名称已存在,请重新填写!", vbExclamation, "系统提示"
'Exit Do
Exit Sub
End If
Loop
'i = 1
' While Not rd.EOF
'' rd.MoveFirst
'
' If Trim(TxtLoginName.Text) = Trim(rd!login_id) Then
'
' If Trim(Txtpassword.Text) = Trim(rd.Fields("password")) Then
' user_type = Trim(rd.Fields("popedom")) '得到用户标识,以便确定用户权限
' Unload Me
' FrmMain.Show 1
' Exit Sub
' Else
' MsgBox "您输入的密码不正确!", vbExclamation, "系统提示"
' Exit Sub
' End If
' Else
' rd.MoveNext
' i = i + 1
' End If
' Wend
sql = "insert into factory_info (fct_name,fct_principal,fct_tel,fct_add,fct_postalcode,fct_type ) values ('" + Trim(Txtfct_name) + "','" + Trim(Txtfct_principal) + "','" + Trim(Txtfct_tel) + "','" + Trim(Txtfct_add) + "','" + Trim(Txtfct_postalcode) + "','1')"
gDbFish.Execute sql
MsgBox "数据输入成功!", vbDefaultButton1, "系统提示"
CmdOk2.Enabled = False
ErrHandle:
End Sub
Private Sub CmdOk3_Click()
On Error GoTo ErrHandle
Dim rd As Recordset
Dim i As String
Dim sql As String
If Txtpd_id.Text = "" Then
MsgBox "您未输入产品类型编号,请输入! 建议使用产品名称的拼音缩写...", vbExclamation, "系统提示"
Exit Sub
End If
If Txtpd_kind_name.Text = "" Then
MsgBox "您未输入产品类型名称,请输入!", vbExclamation, "系统提示"
Exit Sub
End If
Set rd = gDbFish.OpenRecordset("select * from product_kind")
i = 1
Do While Not rd.EOF '表中数据不为空既数据指针不指在最后一条
If Trim(Txtpd_id.Text) <> Trim(rd.Fields("pd_id")) Then
i = i + 1
rd.MoveNext
Else
MsgBox "您输入的产品类型编号已存在,请重新填写!", vbExclamation, "系统提示"
'Exit Do
Exit Sub
End If
Loop
If rd.EOF Then
'sql = "insert into product_kind (pd_id,pd_kind_name,pd_type) values ('" + Trim(Txtpd_id) + "','" + Trim(Txtpd_kind_name) + "','" + i + "')"
sql = "insert into product_kind (pd_id,pd_kind_name) values ('" + Trim(Txtpd_id) + "','" + Trim(Txtpd_kind_name) + "')"
gDbFish.Execute sql
MsgBox "数据输入成功!", vbDefaultButton1, "系统提示"
CmdOk3.Enabled = False
End If
ErrHandle:
End Sub
Private Sub Form_Load()
On Error GoTo Err
If Cbxpopedom.ListCount > 1 Then Cbxpopedom.ListIndex = 0
Err:
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
FrmMain.Show
End Sub
Private Sub Txtfct_add_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtfct_tel.SetFocus
Err:
End Sub
Private Sub Txtfct_name_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtfct_principal.SetFocus
Err:
End Sub
Private Sub Txtfct_postalcode_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then CmdOk2.SetFocus
Err:
End Sub
Private Sub Txtfct_principal_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtfct_add.SetFocus
Err:
End Sub
Private Sub Txtfct_tel_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtfct_postalcode.SetFocus
Err:
End Sub
Private Sub Txtlogin_id_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtposition.SetFocus
Err:
End Sub
Private Sub Txtpassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then Cbxpopedom.SetFocus
End Sub
Private Sub Txtpd_id_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtpd_kind_name.SetFocus
Err:
End Sub
Private Sub Txtpd_kind_name_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then CmdOk3.SetFocus
Err:
End Sub
Private Sub Txtposition_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtpassword.SetFocus
Err:
End Sub
Private Sub Txtsurepassword_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then CmdOk1.SetFocus
Err:
End Sub
Private Sub Txtuser_name_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err
If KeyCode = 13 Or KeyCode = 40 Then Txtlogin_id.SetFocus
Err:
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -