📄 frm_gsxx.frm
字号:
End
Begin VB.Label Label1
Caption = "公司名称"
Height = 255
Left = 360
TabIndex = 2
Top = 550
Width = 975
End
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 810
Left = 0
TabIndex = 0
Top = 0
Width = 6915
_ExtentX = 12197
_ExtentY = 1429
ButtonWidth = 1138
ButtonHeight = 1376
Appearance = 1
Style = 1
ImageList = "ImageList1"
HotImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 5
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 编辑 "
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "取消"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "打印"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
ImageIndex = 5
EndProperty
EndProperty
BorderStyle = 1
End
End
Attribute VB_Name = "frm_GSXX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i
Public adoCon As New ADODB.Connection
Public adoRs As New ADODB.Recordset
Private Sub Form_Load()
Adodc1.RecordSource = "select * from Table_GSXX "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("公司名称")
Text2.Text = Adodc1.Recordset.Fields("邮编")
Text3.Text = Adodc1.Recordset.Fields("传真")
Text4.Text = Adodc1.Recordset.Fields("电话")
Text5.Text = Adodc1.Recordset.Fields("公司地址")
Text6.Text = Adodc1.Recordset.Fields("公司E_MALL")
Text7.Text = Adodc1.Recordset.Fields("开户银行")
Text8.Text = Adodc1.Recordset.Fields("公司帐号")
Text9.Text = Adodc1.Recordset.Fields("备注")
Else
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
MDI_main.Toolbar1.Visible = True
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text4.SetFocus
Else
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
Else
End If
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text8.SetFocus
Else
End If
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text9.SetFocus
Else
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ljm"
Select Case Button.Index
Case 1
Toolbar1.Buttons(1).Enabled = False
Toolbar1.Buttons(2).Enabled = True
Toolbar1.Buttons(3).Enabled = True
Toolbar1.Buttons(4).Enabled = False
Toolbar1.Buttons(5).Enabled = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Adodc1.RecordSource = "select * from Table_GSXX where 公司名称='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("公司名称")
Text2.Text = Adodc1.Recordset.Fields("邮编")
Text3.Text = Adodc1.Recordset.Fields("传真")
Text4.Text = Adodc1.Recordset.Fields("电话")
Text5.Text = Adodc1.Recordset.Fields("公司地址")
Text6.Text = Adodc1.Recordset.Fields("公司E_MALL")
Text7.Text = Adodc1.Recordset.Fields("开户银行")
Text8.Text = Adodc1.Recordset.Fields("公司帐号")
Text9.Text = Adodc1.Recordset.Fields("备注")
Text2.SetFocus
Else
End If
Case 2
Adodc1.RecordSource = "select * from Table_GSXX where 公司名称='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Text10.Text = Val(Text10.Text) + 1
Set adoRs = adoCon.Execute("insert into Table_GSXX values(" & Text10 & ",'" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "')")
MsgBox "数据保存成功!!", 32, "房地产销售管理系统"
Adodc1.Refresh
Else
Text10.Text = Val(Text10.Text) + 1
Set adoRs = adoCon.Execute("insert into Table_GSXX values(" & Text10 & ",'" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "')")
MsgBox "数据保存成功!!", 32, "房地产销售管理系统"
Adodc1.Refresh
End If
Case 3
Toolbar1.Buttons(1).Enabled = True
Toolbar1.Buttons(2).Enabled = False
Toolbar1.Buttons(3).Enabled = False
Toolbar1.Buttons(4).Enabled = True
Toolbar1.Buttons(5).Enabled = True
Adodc1.RecordSource = "select * from Table_GSXX where 公司名称='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("公司名称")
Text2.Text = Adodc1.Recordset.Fields("邮编")
Text3.Text = Adodc1.Recordset.Fields("传真")
Text4.Text = Adodc1.Recordset.Fields("电话")
Text5.Text = Adodc1.Recordset.Fields("公司地址")
Text6.Text = Adodc1.Recordset.Fields("公司E_MALL")
Text7.Text = Adodc1.Recordset.Fields("开户银行")
Text8.Text = Adodc1.Recordset.Fields("公司帐号")
Text9.Text = Adodc1.Recordset.Fields("备注")
Text2.SetFocus
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
Text7.Locked = True
Text8.Locked = True
Text9.Locked = True
Else
End If
Case 4
frm_dygsxx.Text1.Text = Text1.Text
frm_dygsxx.Text2.Text = Text2.Text
frm_dygsxx.Text3.Text = Text3.Text
frm_dygsxx.Text4.Text = Text4.Text
frm_dygsxx.Text5.Text = Text5.Text
frm_dygsxx.Text6.Text = Text6.Text
frm_dygsxx.Text7.Text = Text7.Text
frm_dygsxx.Text8.Text = Text8.Text
frm_dygsxx.Text9.Text = Text9.Text
i = MsgBox("确认打印吗?", 33, "房地产销售管理系统")
If i = vbOK Then
frm_dygsxx.PrintForm
Else
End If
Case 5
Unload Me
MDI_main.Toolbar1.Visible = True
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -