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

📄 wupinadd.frm

📁 一个简单的大学宿舍管理系统环境:vb6.0+acce
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form wupinadd 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "添加物品"
   ClientHeight    =   3900
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   7350
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3900
   ScaleWidth      =   7350
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   4440
      Top             =   1920
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame1 
      Height          =   3855
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   7335
      Begin VB.TextBox Text8 
         Height          =   270
         Left            =   3120
         TabIndex        =   19
         Top             =   300
         Width           =   855
      End
      Begin VB.CommandButton Command3 
         Caption         =   "退出"
         Height          =   375
         Left            =   6240
         TabIndex        =   17
         Top             =   3240
         Width           =   735
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取消"
         Height          =   375
         Left            =   6240
         TabIndex        =   16
         Top             =   2640
         Width           =   735
      End
      Begin VB.CommandButton Command1 
         Caption         =   "添加"
         Height          =   375
         Left            =   6240
         TabIndex        =   15
         Top             =   2040
         Width           =   735
      End
      Begin VB.TextBox Text7 
         Height          =   1215
         Left            =   1200
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   14
         Top             =   2400
         Width           =   4575
      End
      Begin VB.TextBox Text6 
         Height          =   615
         Left            =   1200
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   13
         Top             =   1560
         Width           =   4575
      End
      Begin VB.TextBox Text5 
         Height          =   270
         Left            =   5040
         TabIndex        =   12
         Top             =   900
         Width           =   855
      End
      Begin VB.TextBox Text4 
         Height          =   270
         Left            =   3120
         TabIndex        =   11
         Top             =   900
         Width           =   735
      End
      Begin VB.TextBox Text3 
         Height          =   270
         Left            =   1200
         TabIndex        =   10
         Top             =   900
         Width           =   735
      End
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   5040
         TabIndex        =   4
         Top             =   300
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   1200
         TabIndex        =   2
         Top             =   300
         Width           =   1095
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "公寓"
         Height          =   180
         Left            =   2520
         TabIndex        =   18
         Top             =   360
         Width           =   360
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "备注"
         Height          =   180
         Left            =   480
         TabIndex        =   9
         Top             =   2400
         Width           =   360
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "用途"
         Height          =   180
         Left            =   480
         TabIndex        =   8
         Top             =   1560
         Width           =   360
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "总价(元)"
         Height          =   180
         Left            =   4080
         TabIndex        =   7
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "单价(元)"
         Height          =   180
         Left            =   2160
         TabIndex        =   6
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "数量"
         Height          =   180
         Left            =   480
         TabIndex        =   5
         Top             =   960
         Width           =   360
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "名称"
         Height          =   180
         Left            =   4440
         TabIndex        =   3
         Top             =   360
         Width           =   360
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "添加日期"
         Height          =   180
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   720
      End
   End
End
Attribute VB_Name = "wupinadd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error Resume Next
If Text5.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
 MsgBox "请输入详细信息!", , "提示"
Else
With Adodc1
.Recordset.AddNew
.Recordset.Fields(0).Value = Text1.Text
.Recordset.Fields(1).Value = Text8.Text
.Recordset.Fields(2).Value = Text2.Text
.Recordset.Fields(3).Value = Text3.Text
.Recordset.Fields(4).Value = Text4.Text
.Recordset.Fields(5).Value = Text5.Text
.Recordset.Fields(6).Value = Text6.Text
.Recordset.Fields(7).Value = Text7.Text
.Recordset.Update
End With
Set main.DataGrid1.datasource = Adodc1
main.DataGrid1.Refresh
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End If
End Sub

Private Sub Command2_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
Adodc1.Recordset.MovePrevious
End Sub

Private Sub Command5_Click()
Adodc1.Recordset.MoveNext
End Sub

Private Sub Form_Load()
On Error Resume Next
provider = "provider=Microsoft.jet.oledb.4.0"
datasource = "data source=" & App.Path & "\DB.mdb"

With Adodc1
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "zichan"
.Refresh
End With

Text1.Text = Date
Text1.Enabled = False
Set main.DataGrid1.datasource = Adodc1
main.DataGrid1.Refresh
End Sub

Private Sub Text5_Click()
If Text4.Text = "" Then
MsgBox "请输入单价", , "提示"
Exit Sub
End If

If Text2.Text = "" Then
Text2.Text = 1
End If
Text5.Text = Trim(Text3.Text) * Trim(Text4.Text)
End Sub

⌨️ 快捷键说明

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