收款情况录入.frm

来自「本软件为咨询公司开发的合同管理软件,运用MDB数据库.」· FRM 代码 · 共 276 行

FRM
276
字号
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form 收款情况录入 
   Caption         =   "合同收款情况录入"
   ClientHeight    =   6720
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8685
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "收款情况录入.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6720
   ScaleWidth      =   8685
   StartUpPosition =   2  '屏幕中心
   Begin VB.ComboBox Combo2 
      Height          =   360
      Left            =   1920
      TabIndex        =   12
      Top             =   1680
      Width           =   2175
   End
   Begin VB.ComboBox Combo1 
      Height          =   360
      Left            =   1920
      TabIndex        =   11
      Top             =   3100
      Width           =   2175
   End
   Begin MSComCtl2.DTPicker DTP1 
      Height          =   375
      Left            =   1920
      TabIndex        =   9
      Top             =   1080
      Width           =   2175
      _ExtentX        =   3836
      _ExtentY        =   661
      _Version        =   393216
      Format          =   23658497
      CurrentDate     =   39432
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   4200
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   4560
      Visible         =   0   'False
      Width           =   1335
   End
   Begin MSFlexGridLib.MSFlexGrid Grid1 
      Height          =   2535
      Left            =   0
      TabIndex        =   8
      Top             =   4200
      Width           =   8655
      _ExtentX        =   15266
      _ExtentY        =   4471
      _Version        =   393216
      Cols            =   6
      BackColorFixed  =   12648447
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返  回"
      Height          =   375
      Left            =   6240
      TabIndex        =   7
      Top             =   2400
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确  定"
      Height          =   375
      Left            =   6240
      TabIndex        =   6
      Top             =   1320
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   1920
      TabIndex        =   5
      Top             =   2400
      Width           =   2175
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1920
      TabIndex        =   1
      Top             =   480
      Width           =   2175
   End
   Begin VB.Label Label5 
      Caption         =   "收款情况:"
      Height          =   495
      Left            =   600
      TabIndex        =   10
      Top             =   3120
      Width           =   1215
   End
   Begin VB.Line Line1 
      X1              =   5280
      X2              =   5280
      Y1              =   0
      Y2              =   4200
   End
   Begin VB.Label Label4 
      Caption         =   "收到金额:"
      Height          =   495
      Left            =   600
      TabIndex        =   4
      Top             =   2400
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "收款类型:"
      Height          =   495
      Left            =   600
      TabIndex        =   3
      Top             =   1755
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "收款日期:"
      Height          =   495
      Left            =   600
      TabIndex        =   2
      Top             =   1125
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "合同编号:"
      Height          =   495
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "收款情况录入"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db1 As ADODB.Connection
Dim db2 As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim rs2 As ADODB.Recordset
Dim sqlcx As String
Dim i As String * 2

Private Sub Command1_Click()
 
If Trim(Text1.Text = "") Or Trim(Combo2.Text = "") Or Trim(Combo2.Text = "") Then
 MsgBox "录入的项目不能为空,请检查!!", vbOKOnly, "提示信息!!"
Else
 aa = MsgBox("你输入的数据正确吗?, 真的要保存数据吗?", vbYesNo, "保存按是, 否则按否!")

 
 If aa = 6 Then
 i = i + 1
 Grid1.Rows = Grid1.Rows + 1
 Data1.Recordset.AddNew
 Data1.Recordset.Fields(0) = Trim(Text1.Text)
 Data1.Recordset.Fields(3) = CStr(Format(DTP1.Value, "yy-mm-dd"))
 Data1.Recordset.Fields(1) = Trim(Combo2.Text)
 Data1.Recordset.Fields(2) = Trim(Text4.Text)
 Data1.Recordset.Fields(4) = Trim(Combo1.Text)

 Data1.Recordset.Update
 Grid1.TextMatrix(i, 1) = Trim(Text1.Text)
 Grid1.TextMatrix(i, 2) = CStr(Format(DTP1.Value, "yy-mm-dd"))

 Grid1.TextMatrix(i, 3) = Trim(Combo2.Text)
 Grid1.TextMatrix(i, 4) = Trim(Text4.Text)
 Grid1.TextMatrix(i, 5) = Trim(Combo1.Text)

 Text1.Text = ""
 Combo2.Text = ""
 Text4.Text = ""
 Combo1.Text = ""
 End If
End If

End Sub

Private Sub Command2_Click()

'rs1.Close
'rs1.ActiveConnection = Nothing
'db1.Close
'Data1.Recordset.Close
Unload Me
End Sub

Private Sub Command2_LostFocus()
'aa = MsgBox("你输入的合同号不存在, 你要重新输入吗?", vbYesNo, "重新输入按是, 否则按否!")
'If aa <> 6 Then
'rs1.Close
'rs1.ActiveConnection = Nothing
'Data1.Recordset.Close
Unload Me
'End If

End Sub

Private Sub Form_Load()
Combo1.AddItem "第一笔"
Combo1.AddItem "第二笔"
Combo1.AddItem "第三笔"
Combo2.AddItem "现金"
Combo2.AddItem "支票"
Combo2.AddItem "转帐"


Set db2 = New ADODB.Connection
Set rs2 = New ADODB.Recordset
'dblj = "C:\htgl\data\htxxk.mdb"

db2.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & dblj & ";Persist Security Info=False"
rs2.Open "收款情况", db2
Data1.DatabaseName = dblj
Data1.RecordSource = "收款情况"
    Grid1.ColWidth(0) = 0
    Grid1.ColWidth(1) = 1000
    Grid1.ColWidth(2) = 2500
    Grid1.ColWidth(3) = 1800
    Grid1.ColWidth(4) = 1800
    Grid1.ColWidth(5) = 1800
    
    Grid1.Rows = 2
    Grid1.TextMatrix(0, 1) = "合同编号"
    Grid1.TextMatrix(0, 2) = "     收款日期"
    Grid1.TextMatrix(0, 3) = "   收款类型"
    Grid1.TextMatrix(0, 4) = "  收到金额"
    Grid1.TextMatrix(0, 5) = "  收款情况"
   
    i = 0
 DTP1.Value = Date
End Sub

Private Sub Text1_LostFocus()
Set db1 = New ADODB.Connection
Set rs1 = New ADODB.Recordset
db1.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & dblj & ";Persist Security Info=False"
sqlcx = "select * from  合同信息表 where 编号 = " & "'" & Trim(Text1.Text) & "'"
rs1.Open sqlcx, db1, adOpenKeyset, adLockBatchOptimistic
If rs1.EOF Then
aa = MsgBox("你输入的合同号不存在, 请重新输入", vbOKOnly)
收款情况录入.Caption = "项目单位名称:"
'Text1.Text = ""
'Text1.SetFocus
Else

收款情况录入.Caption = ""
收款情况录入.Caption = "项目单位名称:" & 收款情况录入.Caption & rs1!单位名称 & "     签约人:" & rs1!签约人
End If

End Sub

⌨️ 快捷键说明

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