frmcustomer.frm
来自「很好! 很实用! 免费!」· FRM 代码 · 共 321 行
FRM
321 行
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmCustomer
ClientHeight = 7755
ClientLeft = 60
ClientTop = 345
ClientWidth = 9210
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 7755
ScaleWidth = 9210
Begin ClassSystem.ExcelGrid ExcelGrid1
Height = 6015
Left = 360
TabIndex = 1
Top = 1200
Width = 8055
_ExtentX = 14208
_ExtentY = 10610
DisplayOfficeLogo= -1 'True
DisplayToolbar = 0 'False
End
Begin MSComctlLib.Toolbar topToolbar
Align = 1 'Align Top
Height = 555
Left = 0
TabIndex = 0
Top = 0
Width = 9210
_ExtentX = 16245
_ExtentY = 979
ButtonWidth = 1455
ButtonHeight = 926
Appearance = 1
Style = 1
ImageList = "toolbarImageList1"
HotImageList = "toolbarImageList2"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 9
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "新加"
Key = "Insert"
Object.ToolTipText = "新加"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "Update"
Object.ToolTipText = "修改"
ImageIndex = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "Delete"
Object.ToolTipText = "删除"
ImageIndex = 4
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "拜访"
Key = "Visiting"
Object.ToolTipText = "拜访"
ImageIndex = 10
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "价格"
Key = "Price"
Object.ToolTipText = "价格"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 合同"
Key = "Contract"
Object.ToolTipText = " 合同"
ImageIndex = 10
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "销售订单"
Key = "SaleOrder"
Object.ToolTipText = "销售订单"
ImageIndex = 6
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "采购订单"
Key = "PurchaseOrder"
Object.ToolTipText = "采购订单"
ImageIndex = 7
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 退 出 "
Key = "Exit"
Object.ToolTipText = " 退 出"
ImageIndex = 11
EndProperty
EndProperty
BorderStyle = 1
Begin MSComctlLib.ImageList toolbarImageList2
Left = 8040
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 15
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 11
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":0542
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":0A84
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":0FC6
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":1162
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":16A4
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":19F8
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":1D4C
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":228E
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":27D0
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":2D12
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList toolbarImageList1
Left = 7320
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 15
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 11
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":2E1C
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":335E
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":38A0
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":3DE2
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":3F7C
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":44BE
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":4812
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":4B66
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":50A8
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":55EA
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmCustomer.frx":5B2C
Key = ""
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmCustomer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
'button
If g_ButtonArrange Then
topToolbar.TextAlignment = tbrTextAlignBottom
Else
topToolbar.TextAlignment = tbrTextAlignRight
End If
'caption
Me.Caption = "客户资料"
Call RefreshData
End Sub
Private Sub Form_Resize()
On Error Resume Next
ExcelGrid1.Left = 10
ExcelGrid1.Width = Me.Width - 20
ExcelGrid1.Top = topToolbar.Top + topToolbar.Height + 100
ExcelGrid1.Height = Me.Height - ExcelGrid1.Top - 300
Err.Clear
End Sub
Private Sub topToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim sSQL As String
Dim objCustomer As New clsCustomer
Select Case Button.Key
Case "Insert"
frmCustomerInsert.Show vbModal
Case "Update"
frmCustomerUpdate.Show vbModal
Case "Delete"
If MsgBox("确实要删除吗?", vbYesNo, "删除仓库") = vbYes Then
objCustomer.m_ID = Me.ExcelGrid1.DataRecordset.Fields("ID").value
objCustomer.Delete
RefreshData
End If
Case "Exit"
Unload Me
Case "Price"
If ExcelGrid1.DataRecordset.RecordCount > 0 Then
With frmCustomerPrice
.sCustID = ExcelGrid1.DataRecordset.Fields("ID").value
.sCustName = ExcelGrid1.DataRecordset.Fields("Name").value
End With
ShowForm frmCustomerPrice
End If
Case "SaleOrder"
If ExcelGrid1.DataRecordset.RecordCount > 0 Then
With frmSaleOrder
.sCustID = ExcelGrid1.DataRecordset.Fields("ID").value
.sCustName = ExcelGrid1.DataRecordset.Fields("Name").value
End With
ShowForm frmSaleOrder
End If
Case "Contract"
If ExcelGrid1.DataRecordset.RecordCount > 0 Then
With frmCustomerContract
.sCustID = ExcelGrid1.DataRecordset.Fields("ID").value
.sCustName = ExcelGrid1.DataRecordset.Fields("Name").value
End With
ShowForm frmCustomerContract
End If
Case "Visiting"
If ExcelGrid1.DataRecordset.RecordCount > 0 Then
With frmCustomerVisiting
.sCustID = ExcelGrid1.DataRecordset.Fields("ID").value
.sCustName = ExcelGrid1.DataRecordset.Fields("Name").value
End With
ShowForm frmCustomerVisiting
End If
Case "PurchaseOrder"
If ExcelGrid1.DataRecordset.RecordCount > 0 Then
With frmPurchaseOrder
.sCustID = ExcelGrid1.DataRecordset.Fields("ID").value
.sCustName = ExcelGrid1.DataRecordset.Fields("Name").value
End With
ShowForm frmPurchaseOrder
End If
End Select
End Sub
Public Sub RefreshData()
Dim rsTemp As ADODB.Recordset
Dim sSQL As String
sSQL = "select ID,PatentID,No,Type,Status,Name,OwnerShip,Synopsis,Management,ManNumber," & _
"Capital,Taking,Service,FictitiousMan,FinanceMan,PurchaseMan,SaleMan,AreaID,Address,PostCode," & _
"Telephone,Fax,Email,Http,Credit,ContributeRate,BackRate,Back,BackProfile,OperatorID" & _
",CreateDate, ModifyDate from CoCustomer order by No"
Set rsTemp = g_cn.Execute(sSQL)
ExcelGrid1.RelativeGrid rsTemp, "No,Type,Status,Name,OwnerShip,Synopsis,Management,ManNumber," & _
"Capital,Taking,Service,FictitiousMan,FinanceMan,PurchaseMan,SaleMan,AreaID,Address,PostCode," & _
"Telephone,Fax,Email,Http,Credit,ContributeRate,BackRate,Back,BackProfile", "No,Type,Status,Name,OwnerShip,Synopsis,Management,ManNumber," & _
"Capital,Taking,Service,FictitiousMan,FinanceMan,PurchaseMan,SaleMan,AreaID,Address,PostCode," & _
"Telephone,Fax,Email,Http,Credit,ContributeRate,BackRate,Back,BackProfile"
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?