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

📄 m2.bas

📁 办公自动化 vb+server2
💻 BAS
📖 第 1 页 / 共 2 页
字号:
   rs.Update
   rs.Close
   
 grs.CursorLocation = adUseClient
   grs.Open "select * from " & biaoming & "", gconn, adOpenKeyset, adLockPessimistic
With grs
     .AddNew
     .Fields(0) = "0"
     .Fields(1) = "0"
     .Fields(2) = "0:00:00"
     For m = 3 To 130
     .Fields(m) = "0"
     Next
     
     .Fields(0) = Form7.Text1(1).Text '建设单位
     .Fields(1) = Form7.Text1(0).Text '工程编号
     .Fields(65) = "1" '系数1
     .Fields(66) = "1" '系数2
     .Fields(123) = "1" '打折
     .Fields(128) = aa(11) '预收款
End With
   grs.Update
   grs.Close
   
   grs.CursorLocation = adUseClient '增加流程记录的数据
   grs.Open "select * from 流程记录", gconn, adOpenKeyset, adLockPessimistic
   grs.AddNew
   grs("sp_rws_num").Value = Form7.Text1(0).Text
   grs("sp_fromman_dept").Value = department
   grs("sp_fromman").Value = username
   grs("sp_opinion").Value = "0"
   grs("sp_xz").Value = "登记"
   grs.Update
   grs.Close
   
   
   
   
  MsgBox "数据存储完毕!", vbInformation, "存储数据"
  Form7.ListView1.ListItems.Clear
           rs.CursorLocation = adUseClient
         rs.Open "select * from " & biaoming & " order by 工程编号", conn, adOpenKeyset, adLockPessimistic
         For o = 1 To rs.RecordCount
                Form7.ListView1.ListItems.Add , , rs.Fields(0).Value
                For p = 1 To 18
                Form7.ListView1.ListItems.Item(o).SubItems(p) = rs.Fields(p).Value
                Next
              rs.MoveNext
           Next
           rs.Close
                 Form7.ListView1.ListItems(Form7.ListView1.ListItems.Count).Selected = True
                 Form7.ListView1.SelectedItem.EnsureVisible
                 Form7.ListView1.Refresh
        For q = 0 To 17
            Form7.Text1(q).Text = ""
        Next
        
da = Date
Form7.Text1(5).Text = da
Form7.Text1(6).Text = da
Form7.Text1(17).Text = username
End Sub
Public Sub renwushu4(biaoming As String)
Dim da As Date
   rs.CursorLocation = adUseClient
   rs.Open "select * from " & biaoming & "", conn, adOpenKeyset, adLockPessimistic
  If Form12.Text1(0).Text <> "" Then
   a = Form12.Text1(0).Text
   f = Len(a)
   SearchString = a ' 被搜索的字符串。
   SearchChar = "-"   ' 要查找字符串 "P"。
   MyPos = InStr(1, SearchString, SearchChar, 1)
   If MyPos = 0 Then
        ln = MsgBox("输入格式不对,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = a
        rs.Close
    Exit Sub
    End If
    If MyPos <> "0" Then
    If biaoming = "竣工" Then
       b = left(a, MyPos - 1)
       c = right(a, f - MyPos)
        Form12.Text1(0).Text = b & "竣工" & c & "号"
     End If
         If biaoming = "建筑物位置测定" Then
       b = left(a, MyPos - 1)
       c = right(a, f - MyPos)
        Form12.Text1(0).Text = b & "验字" & c & "号"
     End If
    End If
  Else
     ln = MsgBox("工程编号不能为空,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = ""
        rs.Close
       Exit Sub
  End If


  If Form12.Text1(16).Text <> "" Then
   a1 = Form12.Text1(16).Text
   f1 = Len(a1)
   SearchString1 = a1 ' 被搜索的字符串。
   SearchChar1 = "-"   ' 要查找字符串 "P"。
   MyPos1 = InStr(1, SearchString1, SearchChar1, 1)
   If MyPos1 = 0 Then
        ln = MsgBox("输入格式不对,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = a
        Form12.Text1(16).Text = a1
        rs.Close
    Exit Sub
   End If
    If MyPos1 <> "0" Then
     b1 = left(a1, MyPos1 - 1)
     c1 = right(a1, f1 - MyPos1)
     Form12.Text1(16).Text = "哈规城管字" & "[" & b1 & "]" & c1 & "号"
   End If

   Else
    ln = MsgBox("规划报件审批编号不能为空,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = a
        Form12.Text1(16).Text = a1
        rs.Close
      Exit Sub
   End If

  For i = 1 To rs.RecordCount
      g = rs.Fields(0)
      g1 = rs.Fields(18).Value
     If Form12.Text1(0).Text = g Then
       ln = MsgBox("工程编号已存在,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = a
        Form12.Text1(16).Text = a1
        rs.Close
       Exit Sub
       End If
     If Form12.Text1(16).Text = g1 Then
       ln = MsgBox("规划报件审批编号已存在,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = a
        Form12.Text1(16).Text = a1
        rs.Close
       Exit Sub
       End If
       rs.MoveNext
   Next
For j = 6 To 11
    If Form12.Text1(j).Text <> "" Then
     If Not IsDate(Form12.Text1(j).Text) Then
       MsgBox "建成时间格式(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告!"
       Form12.Text1(j).Text = ""
        Form12.Text1(0).Text = a
        Form12.Text1(16).Text = a1
       rs.Close
      Exit Sub
      End If
     End If
Next
   



For n = 0 To 18
 If n >= 6 And n <= 11 Then
    If Form12.Text1(n).Text = "" Then
      bb(n) = "0:00:00"
     Else
      bb(n) = Form12.Text1(n).Text
    End If
 Else
  If Form12.Text1(n).Text = "" Then
     bb(n) = "0"
    Else
     bb(n) = Form12.Text1(n).Text
  End If
 End If
Next
With rs
     .AddNew
     .Fields(0) = bb(0)
     .Fields(17) = bb(1)
     For m = 1 To 14
     .Fields(m) = bb(m + 1)
     Next
     .Fields(15) = "0"
     .Fields(16) = "0"
     .Fields(18) = bb(16)
     .Fields(19) = bb(17)
     .Fields(20) = bb(18)
End With
   rs.Update
   rs.Close

 grs.CursorLocation = adUseClient
   grs.Open "select * from " & biaoming & "", gconn, adOpenKeyset, adLockPessimistic
With grs
     .AddNew
     .Fields(0) = "0"
     .Fields(1) = "0"
     .Fields(2) = "0:00:00"
     For m = 3 To 130
     .Fields(m) = "0"
     Next
     
     .Fields(0) = Form12.Text1(2).Text '建设单位
     .Fields(1) = Form12.Text1(0).Text '工程编号
     .Fields(65) = "1" '系数1
     .Fields(66) = "1" '系数2
     .Fields(123) = "1" '打折
     .Fields(128) = bb(12) '预收款
End With
   grs.Update
   grs.Close


   grs.CursorLocation = adUseClient '增加流程记录的数据
   grs.Open "select * from 流程记录", gconn, adOpenKeyset, adLockPessimistic
   grs.AddNew
   grs("sp_rws_num").Value = Form12.Text1(0).Text
   grs("sp_fromman_dept").Value = department
   grs("sp_fromman").Value = username
   grs("sp_opinion").Value = "0"
   grs("sp_xz").Value = "登记"
   grs.Update
   grs.Close



  MsgBox "数据存储完毕!", vbInformation, "存储数据"
  Form12.ListView1.ListItems.Clear
           rs.CursorLocation = adUseClient
         rs.Open "select * from " & biaoming & " order by 工程编号", conn, adOpenKeyset, adLockPessimistic
         For o = 1 To rs.RecordCount
                Form12.ListView1.ListItems.Add , , rs.Fields(0).Value
                For p = 1 To 20
                Form12.ListView1.ListItems.Item(o).SubItems(p) = rs.Fields(p).Value
                Next
              rs.MoveNext
           Next
           rs.Close
                 Form12.ListView1.ListItems(Form12.ListView1.ListItems.Count).Selected = True
                 Form12.ListView1.SelectedItem.EnsureVisible
                 Form12.ListView1.Refresh
        For q = 0 To 18
            Form12.Text1(q).Text = ""
        Next
        
da = Date
Form12.Text1(6).Text = da
Form12.Text1(7).Text = da
Form12.Text1(18).Text = username
End Sub
Public Sub renwushu5(biaoming As String)
Dim da As Date
   rs.CursorLocation = adUseClient
   rs.Open "select * from " & biaoming & "", conn, adOpenKeyset, adLockPessimistic
  If Form12.Text1(0).Text = "" Then
     ln = MsgBox("工程编号不能为空,请重新输入!", vbInformation, "提示")
        Form12.Text1(0).Text = ""
        rs.Close
       Exit Sub
  End If
  For i = 1 To rs.RecordCount
      g = rs.Fields(0)
     If Form12.Text1(0).Text = g Then
       ln = MsgBox("工程编号已存在,请重新输入!", vbInformation, "提示")
        rs.Close
       Exit Sub
       End If
       rs.MoveNext
   Next
For j = 6 To 11
    If Form12.Text1(j).Text <> "" Then
     If Not IsDate(Form12.Text1(j).Text) Then
       MsgBox "建成时间格式(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告!"
       Form12.Text1(j).Text = ""
       rs.Close
      Exit Sub
      End If
     End If
Next
For n = 0 To 18
 If n >= 6 And n <= 11 Then
    If Form12.Text1(n).Text = "" Then
      bb(n) = "0:00:00"
     Else
      bb(n) = Form12.Text1(n).Text
    End If
 Else
  If Form12.Text1(n).Text = "" Then
     bb(n) = "0"
    Else
     bb(n) = Form12.Text1(n).Text
  End If
 End If
Next
With rs
     .AddNew
     .Fields(0) = bb(0)
     .Fields(17) = bb(1)
     For m = 1 To 14
     .Fields(m) = bb(m + 1)
     Next
     .Fields(15) = "0"
     .Fields(16) = "0"
     .Fields(18) = bb(17)
     .Fields(19) = bb(18)
End With
   rs.Update
   rs.Close

 grs.CursorLocation = adUseClient
 grs.Open "select * from " & biaoming & "", gconn, adOpenKeyset, adLockPessimistic
With grs
     .AddNew
     .Fields(0) = "0"
     .Fields(1) = "0"
     .Fields(2) = "0:00:00"
     For m = 3 To 130
     .Fields(m) = "0"
     Next
     
     .Fields(0) = Form12.Text1(2).Text '建设单位
     .Fields(1) = Form12.Text1(0).Text '工程编号
     .Fields(65) = "1" '系数1
     .Fields(66) = "1" '系数2
     .Fields(123) = "1" '打折
     .Fields(128) = bb(12) '预收款
End With
   grs.Update
   grs.Close

   grs.CursorLocation = adUseClient '增加流程记录的数据
   grs.Open "select * from 流程记录", gconn, adOpenKeyset, adLockPessimistic
   grs.AddNew
   grs("sp_rws_num").Value = Form12.Text1(0).Text
   grs("sp_fromman_dept").Value = department
   grs("sp_fromman").Value = username
   grs("sp_opinion").Value = "0"
   grs("sp_xz").Value = "登记"
   grs.Update
   grs.Close



  MsgBox "数据存储完毕!", vbInformation, "存储数据"
  Form12.ListView1.ListItems.Clear
           rs.CursorLocation = adUseClient
         rs.Open "select * from " & biaoming & " order by 工程编号", conn, adOpenKeyset, adLockPessimistic
         For o = 1 To rs.RecordCount
                Form12.ListView1.ListItems.Add , , rs.Fields(0).Value
                For p = 1 To 17
                Form12.ListView1.ListItems.Item(o).SubItems(p) = rs.Fields(p).Value
                Next
                Form12.ListView1.ListItems.Item(o).SubItems(19) = rs.Fields(18).Value
                Form12.ListView1.ListItems.Item(o).SubItems(20) = rs.Fields(19).Value
              rs.MoveNext
           Next
           rs.Close
                 Form12.ListView1.ListItems(Form12.ListView1.ListItems.Count).Selected = True
                 Form12.ListView1.SelectedItem.EnsureVisible
                 Form12.ListView1.Refresh
        For q = 0 To 18
            Form12.Text1(q).Text = ""
        Next
        
da = Date
Form12.Text1(6).Text = da
Form12.Text1(7).Text = da
Form12.Text1(18).Text = username
End Sub

⌨️ 快捷键说明

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