⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsjedit.frm

📁 朋友给的
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         TabIndex        =   9
         Top             =   1245
         Width           =   1485
      End
      Begin VB.Label Label3 
         Caption         =   "客户需求"
         Height          =   300
         Left            =   360
         TabIndex        =   8
         Top             =   765
         Width           =   1485
      End
      Begin VB.Label Label2 
         Caption         =   "地点"
         Height          =   300
         Left            =   3825
         TabIndex        =   7
         Top             =   360
         Width           =   1485
      End
      Begin VB.Label Label1 
         Caption         =   "客户名称"
         Height          =   300
         Left            =   360
         TabIndex        =   6
         Top             =   360
         Width           =   1485
      End
   End
End
Attribute VB_Name = "frmSJedit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False








Private Sub ADDRESS_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub BFFIRST_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub BFKH_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub








Private Sub BFLAST_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub BFSJ_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub CGYX_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub CmdFind_Click()
    Dim rs As New ADODB.Recordset
    Dim strsql As String
    Dim i As Long
    Set rs = New ADODB.Recordset
    MSFLGSJ.Clear
    If Findbt = "" Or findnr = "" Then
        strsql = "select * from t_事件安排 where 操作员='" & gUser & "'"
    Else
        strsql = "select * from t_事件安排 where " & Trim(Findbt) & " like '%" & findnr & "%' and 操作员='" & gUser & "'"
    End If
    rs.Open strsql, gCnn, adOpenStatic, adLockReadOnly
    MSFLGSJ.Rows = rs.RecordCount + 1
    For i = 1 To rs.RecordCount
        MSFLGSJ.TextMatrix(i, 0) = i
        MSFLGSJ.TextMatrix(i, 1) = rs("拜访客户")
        MSFLGSJ.TextMatrix(i, 2) = rs("拜访时间(从)")
'        MSFLGSJ.TextMatrix(i, 3) = rs("采购意向")
        MSFLGSJ.TextMatrix(i, 3) = rs("地址")
        MSFLGSJ.TextMatrix(i, 4) = rs("后续安排")
        MSFLGSJ.TextMatrix(i, 5) = rs("id")
        rs.MoveNext
    
    Next
End Sub

Private Sub CmdSave_Click()
    Dim rs As New ADODB.Recordset
    Dim strsql As String
    Dim cfsj As String
    Dim cfsj1 As String
    Dim txrq As String
    Dim txrq1 As String
    Dim i As Long
    On Error GoTo ErrHandle
    Set rs = New ADODB.Recordset
    If BFKH = "" Then
        MsgBox "拜访客户不能为空!!", vbInformation, "系统提示"
    End If
    If ADDRESS = "" Then
        MsgBox "地点不能为空!!", vbInformation, "系统提示"
    End If
    
    
    
    
    
    strsql = "select * from hdsj"
    rs.Open strsql, gCnn, adOpenStatic, adLockPessimistic
    rs.AddNew
    rs("bfkh") = BFKH
    rs("address") = ADDRESS
    rs("cgyx") = CGYX
    rs("lxdh") = LXDH
    rs("khly") = KHLY
    rs("bfnr") = BFNR
    cfsj = BFSJ & " " & Hour(BFFIRST) & ":" & Minute(BFFIRST) & ":" & Second(BFFIRST)
    cfsj = Format(cfsj, "yyyy-mm-dd hh:mm:ss")

    rs("bffirst") = cfsj
    cfsj1 = BFSJ & " " & Hour(BFLAST) & ":" & Minute(BFLAST) & ":" & Second(BFLAST)
    cfsj1 = Format(cfsj1, "yyyy-mm-dd hh:mm:ss")
    rs("bflast") = cfsj1
    rs("hxap") = HXAP
    txrq = TXSJ & " " & Hour(TXFIRST) & ":" & Minute(TXFIRST) & ":" & Second(TXFIRST)
    txrq = Format(txrq, "yyyy-mm-dd hh:mm:ss")
    rs("txfirst") = txrq
    txrq1 = TXSJ & " " & Hour(TXLAST) & ":" & Minute(TXLAST) & ":" & Second(TXLAST)
    txrq1 = Format(txrq1, "yyyy-mm-dd hh:mm:ss")
    rs("txlast") = txrq1
    rs("czy") = gUser
    rs.Update
    If rs.State = 1 Then rs.Close
    strsql = "select * from hdsj where czy='" & gUser & "' order by sjid"
    rs.Open strsql, gCnn, adOpenStatic, adLockReadOnly
    MSFLGSJ.Rows = rs.RecordCount + 1
    For i = 1 To rs.RecordCount
        MSFLGSJ.TextMatrix(i, 0) = i
        MSFLGSJ.TextMatrix(i, 1) = rs("bfkh")
        MSFLGSJ.TextMatrix(i, 2) = rs("bflast")
'        MSFLGSJ.TextMatrix(i, 3) = rs("cgyx")
        MSFLGSJ.TextMatrix(i, 3) = rs("address")
        MSFLGSJ.TextMatrix(i, 4) = rs("hxap")
        MSFLGSJ.TextMatrix(i, 5) = rs("sjid")
        rs.MoveNext
    Next
    Exit Sub
ErrHandle:
    MsgBox Err.Description
    
    
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Form_Load()
'    If frmMain.sjstate = "1" Then
'        Findbt.Visible = False
'        findnr.Visible = False
'        CmdFind.Visible = False
'
'    End If
   
    If Me.WindowState = 0 Then Me.Move 0, 0, 10725, 8190
    BFSJ = Now()
    TXSJ = Now
    Dim rs As New ADODB.Recordset
    Dim strsql As String
    Set rs = New ADODB.Recordset
    If frmSJGL.SELDAY <> "" And frmSJGL.SELYear <> "" And frmSJGL.SELMonth <> "" Then
        strsql = "select * from hdsj where year(bffirst)='" & frmSJGL.SELYear & "' and month(bffirst)='" & frmSJGL.SELMonth & "' and day(bffirst)='" & frmSJGL.SELDAY & "' and czy='" & gUser & "'   order by sjid"
        
    ElseIf frmSJGL.SELYear <> "" And frmSJGL.SELMonth <> "" Then
        strsql = "select * from hdsj where year(bffirst)='" & frmSJGL.SELYear & "' and month(bffirst)='" & frmSJGL.SELMonth & "'  and czy='" & gUser & "'  order by sjid"
    Else
        strsql = "select * from hdsj where czy='" & gUser & "' order by sjid"
    End If
    rs.Open strsql, gCnn, adOpenStatic, adLockReadOnly
    MSFLGSJ.Clear
    MSFLGSJ.Rows = rs.RecordCount + 1
    For i = 1 To rs.RecordCount
        
        MSFLGSJ.TextMatrix(i, 0) = i
        MSFLGSJ.TextMatrix(i, 1) = rs("bfkh")
        MSFLGSJ.TextMatrix(i, 2) = rs("bffirst")
        'MSFLGSJ.TextMatrix(i, 3) = rs("cgyx")
        MSFLGSJ.TextMatrix(i, 3) = rs("address")
        MSFLGSJ.TextMatrix(i, 4) = rs("hxap")
        MSFLGSJ.TextMatrix(i, 5) = rs("sjid")
        rs.MoveNext
    Next
    If rs.State = 1 Then rs.Close
    rs.Open "select * from T_事件安排", gCnn, adOpenStatic, adLockReadOnly
    Findbt.Clear
    For i = 0 To rs.Fields.count - 1
        Findbt.AddItem rs.Fields(i).name
    Next
    If rs.State = 1 Then rs.Close
    
    rs.Open "select value from parameters where paratype=6 "
    KHLY.Clear
    For i = 0 To rs.RecordCount - 1
        KHLY.AddItem rs(0)
        rs.MoveNext
    Next
    rs.Close
    
    
    
End Sub

Private Sub HXAP_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub MSFLGSJ_Click()
    Dim rs As New ADODB.Recordset
    Dim strsql As String
    Set rs = New ADODB.Recordset
    strsql = "select * from hdsj where sjid=" & MSFLGSJ.TextMatrix(MSFLGSJ.Row, 5)
    rs.Open strsql, gCnn, adOpenStatic, adLockReadOnly
    If Not rs.EOF Then
        BFKH = rs("bfkh")
        ADDRESS = rs("address")
        CGYX = rs("cgyx")
        LXDH = IIf(IsNull(rs("lxdh")), "", rs("lxdh"))
        KHLY = IIf(IsNull(rs("khly")), "", rs("khly"))
        BFNR = IIf(IsNull(rs("bfnr")), "", rs("bfnr"))
        BFSJ = rs("bffirst")
        BFFIRST = rs("bffirst")
        BFLAST = rs("bflast")
        HXAP = rs("hxap")
        TXSJ = rs("txfirst")
        TXFIRST = rs("txfirst")
        TXLAST = rs("txlast")
    End If
    
    
    
End Sub




Private Sub TXFIRST_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

Private Sub TXSJ_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then SendKeys "{Tab}"
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -