?? lxfs.frm
字號:
VERSION 5.00
Begin VB.Form lxfs
Caption = "Form1"
ClientHeight = 3375
ClientLeft = 60
ClientTop = 450
ClientWidth = 4740
LinkTopic = "Form1"
ScaleHeight = 3375
ScaleWidth = 4740
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 2775
Left = 0
TabIndex = 7
Top = -120
Width = 4695
Begin VB.TextBox Text3
Height = 300
Left = 1320
MaxLength = 4
TabIndex = 1
Text = "Text3"
Top = 360
Width = 3135
End
Begin VB.TextBox Text1
Height = 300
Left = 1320
MaxLength = 100
TabIndex = 2
Top = 840
Width = 3135
End
Begin VB.TextBox Text2
Height = 1200
Left = 1320
MaxLength = 255
MultiLine = -1 'True
TabIndex = 3
Top = 1320
Width = 3135
End
Begin VB.Label Label1
Caption = "序 號:"
Height = 255
Left = 360
TabIndex = 10
Top = 480
Width = 975
End
Begin VB.Label Label2
Caption = "聯系方式:"
Height = 255
Left = 360
TabIndex = 9
Top = 960
Width = 975
End
Begin VB.Label Label3
Caption = "備 注:"
Height = 255
Left = 360
TabIndex = 8
Top = 1440
Width = 975
End
End
Begin VB.Frame Frame2
Height = 735
Left = 0
TabIndex = 0
Top = 2640
Width = 4695
Begin VB.CommandButton c_new
Caption = "新增"
Height = 375
Left = 1560
TabIndex = 6
Top = 240
Width = 855
End
Begin VB.CommandButton c_save
Caption = "保存"
Default = -1 'True
Height = 375
Left = 2640
TabIndex = 5
Top = 240
Width = 855
End
Begin VB.CommandButton c_cancel
Caption = "退出"
Height = 375
Left = 3720
TabIndex = 4
Top = 240
Width = 855
End
End
End
Attribute VB_Name = "lxfs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 塊 名 稱 :聯系方式設置用戶操作界面
'* 功 能 描 述 :聯系方式設置用戶操作界面
'* 程序員姓名 : 石春曉
'* 最后修改人 : 石春曉
'* 最后修改時間:2005/10/11
'**************************************
Option Explicit
Public m_operatorType As Integer ' 操作類型 0 - 新增 1 - 修改
Public m_lxfsid As String ' 修改時其它窗體傳遞過來的參數
Private m_suppliertroukDAO As suppliertroukDAO ' 數據庫操作類
Private m_recordset As ADODB.Recordset ' 數據操作數據集對象
Public f As String
Private Sub c_cancel_Click()
Unload Me
End Sub
Private Sub c_new_Click()
Call Check
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newlxfs
Call clear
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifylxfs
clear
m_operatorType = 0
End If
End If
End Sub
Private Sub c_save_Click()
Call Check
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newlxfs
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifylxfs
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
Set m_suppliertroukDAO = New suppliertroukDAO
Set m_recordset = New ADODB.Recordset
Me.Height = 3930
Me.Width = 4800
SetToCenter Me
If m_operatorType = 0 Then
Me.caption = "聯系方式_新增"
clear
Else
Me.caption = "聯系方式_修改"
FindByIdRefresh
End If
End Sub
'**************************************
'* 功 能 描 述 :聯系方式數據處理函數
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub Newlxfs()
'
Dim ret As Boolean
ret = m_suppliertroukDAO.Newlxfs(m_recordset, Trim(Text3.text), Trim(Text1.text), _
Trim(Text2.text))
End Sub
'**************************************
'* 功 能 描 述 :修改聯系方式處理函數
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub Modifylxfs()
'
Dim ret As Boolean
ret = m_suppliertroukDAO.Modifylxfs(m_recordset, Trim(Text3.text), Trim(Text1.text), _
Trim(Text2.text), m_lxfsid)
End Sub
'**************************************
'* 功 能 描 述 :檢驗數據的合法性
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub Check()
f = "1"
If Trim(Text1.text) = "" Then
MainForm.g_msgText = "聯系方式不能為空!"
HMsgBox MainForm.g_msgText, 0, 1
Text1.SetFocus
f = "0"
Exit Sub
End If
If Trim(Text3.text) = "" Or Not IsNumeric(Trim(Text3.text)) Then
MainForm.g_msgText = "序號不能為空或者類型不正確!"
HMsgBox MainForm.g_msgText, 0, 1
Text3.SetFocus
f = "0"
Exit Sub
End If
End Sub
'**************************************
'* 功 能 描 述 :根據聯系方式ID找到聯系方式資料并顯示在界面上
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub FindByIdRefresh()
Dim ret As Boolean
ret = m_suppliertroukDAO.FindlxfsId(m_recordset, m_lxfsid)
If ret Then
With m_recordset
Text3.text = Trim(.Fields("序號"))
Text1.text = Trim(.Fields("聯系方式"))
Text2.text = Trim(.Fields("備注"))
m_recordset.Close
End With
Else
MainForm.g_msgText = "聯系方式ID不正確,請重新操作!"
HMsgBox MainForm.g_msgText, 0, 1
Unload Me
End If
End Sub
'**************************************
'* 功 能 描 述 :清除界面上文本框里的所有內容
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub clear()
Text1.text = ""
Text2.text = ""
Text3.text = ""
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -