home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Bound Form"
- ClientHeight = 4785
- ClientLeft = 1980
- ClientTop = 1860
- ClientWidth = 6690
- Height = 5190
- Left = 1920
- LinkTopic = "Form1"
- ScaleHeight = 4785
- ScaleWidth = 6690
- Top = 1515
- Width = 6810
- Begin VB.CommandButton cmddelete
- Caption = "&Delete"
- Height = 295
- Left = 1440
- TabIndex = 24
- Top = 4080
- Width = 855
- End
- Begin VB.CommandButton cmdupdate
- Caption = "&Update "
- Height = 295
- Left = 2460
- TabIndex = 23
- Top = 4080
- Width = 855
- End
- Begin VB.CommandButton cmdrefresh
- Caption = "&Refresh"
- Height = 295
- Left = 3420
- TabIndex = 22
- Top = 4080
- Width = 855
- End
- Begin VB.CommandButton cmdadd
- Caption = "&Add"
- Height = 295
- Left = 4440
- TabIndex = 21
- Top = 4080
- Width = 795
- End
- Begin VB.ComboBox comfield
- Height = 315
- Left = 1560
- Style = 2 'Dropdown List
- TabIndex = 19
- Top = 3120
- Visible = 0 'False
- Width = 1875
- End
- Begin VB.TextBox txtcomments
- DataField = "Comments"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 17
- Top = 2280
- Width = 4635
- End
- Begin VB.TextBox txtnotes
- DataField = "Notes"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 15
- Top = 2700
- Width = 4635
- End
- Begin VB.TextBox txtdescription
- DataField = "Description"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 13
- Top = 1860
- Width = 4635
- End
- Begin VB.TextBox txtpubid
- DataField = "PubID"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 11
- Top = 180
- Width = 855
- End
- Begin VB.TextBox txtisbn
- DataField = "ISBN"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 9
- Top = 600
- Width = 1635
- End
- Begin VB.TextBox txtyear
- DataField = "Year Published"
- DataSource = "Data1"
- Height = 315
- Left = 5040
- MultiLine = -1 'True
- TabIndex = 7
- Top = 180
- Width = 855
- End
- Begin VB.CheckBox chkeof
- Caption = "EOF Reached"
- Enabled = 0 'False
- Height = 295
- Left = 2340
- TabIndex = 6
- Top = 3660
- Visible = 0 'False
- Width = 1875
- End
- Begin VB.CheckBox chkbof
- Caption = "BOF Reached"
- Enabled = 0 'False
- Height = 295
- Left = 180
- TabIndex = 5
- Top = 3660
- Visible = 0 'False
- Width = 1875
- End
- Begin VB.CommandButton cmdexit
- Caption = "E&xit"
- Height = 300
- Left = 5400
- TabIndex = 4
- Top = 4080
- Width = 795
- End
- Begin VB.Data Data1
- Align = 2 'Align Bottom
- BOFAction = 1 'BOF
- Caption = "Data Control"
- Connect = "Access"
- DatabaseName = "biblio.mdb"
- EOFAction = 2 'Add New
- Exclusive = 0 'False
- Height = 300
- Left = 0
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "Titles"
- Top = 4485
- Width = 6690
- End
- Begin VB.TextBox txtsubject
- DataField = "Subject"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 3
- Top = 1440
- Width = 4635
- End
- Begin VB.TextBox txttitle
- DataField = "Title"
- DataSource = "Data1"
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 2
- Top = 1020
- Width = 4635
- End
- Begin VB.Label Label1
- Caption = "Order by"
- Height = 285
- Index = 7
- Left = 180
- TabIndex = 20
- Top = 3180
- Visible = 0 'False
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Comments"
- Height = 285
- Index = 6
- Left = 180
- TabIndex = 18
- Top = 2280
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Notes"
- Height = 285
- Index = 5
- Left = 180
- TabIndex = 16
- Top = 2700
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Description"
- Height = 285
- Index = 4
- Left = 180
- TabIndex = 14
- Top = 1860
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Pub. ID"
- Height = 285
- Index = 3
- Left = 180
- TabIndex = 12
- Top = 180
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "ISBN"
- Height = 285
- Index = 2
- Left = 180
- TabIndex = 10
- Top = 600
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Year Published"
- Height = 285
- Index = 1
- Left = 3660
- TabIndex = 8
- Top = 180
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "Subject"
- Height = 285
- Left = 180
- TabIndex = 1
- Top = 1440
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Title"
- Height = 285
- Index = 0
- Left = 180
- TabIndex = 0
- Top = 1020
- Width = 1215
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdadd_Click()
- Data1.Recordset.AddNew
- End Sub
- Private Sub cmddelete_Click()
- Data1.Recordset.Delete
- cmdrefresh_Click
- End Sub
- Private Sub cmdexit_Click()
- Unload Me
- Set Form1 = Nothing
- End Sub
- Private Sub cmdrefresh_Click()
- Data1.Refresh
- End Sub
- Private Sub cmdupdate_Click()
- Data1.UpdateRecord
- End Sub
- Private Sub comfield_Click()
- If Not comfield.Text = "Comments" Then
- Data1.RecordSource = "select * From titles order by [" & comfield.Text & "]"
- Data1.Refresh
- End If
- End Sub
- Private Sub Data1_Error(DataErr As Integer, Response As Integer)
- If DataErr > 0 Then
- MsgBox " The Following Error Occured " & DataErr & " " & Error$
- DataErr = 0
- End If
- End Sub
- Private Sub Data1_Reposition()
- If Data1.Recordset.BOF = True Then
- chkbof.Value = vbChecked
- chkbof.Value = vbUnchecked
- End If
- If Data1.Recordset.EOF = True Then
- chkeof.Value = vbChecked
- chkeof.Value = vbUnchecked
- End If
- End Sub
- Private Sub Data1_Validate(Action As Integer, Save As Integer)
- If Save = False Then
- Exit Sub
- End If
- If MsgBox(" Save Record Changed ", vbYesNo, "", "", 0) = vbNo Then
- Data1.UpdateControls
- Exit Sub
- End If
- 'If MsgBox(" Save Record Changed ", vbYesNo, "", "", 0) = vbNo Then
- ' Action = 0
- ' Exit Sub
- 'End If
- End Sub
- Private Sub Form_Load()
- Dim filepath As String
- Dim x As Integer
- filepath = "\source\chap27\"
- Data1.DatabaseName = filepath & "biblio.mdb"
- Data1.RecordSource = "select * From titles order by pubid ,[year published]"
- Data1.Refresh
- Data1.Align = 2
- For x = 0 To Data1.Recordset.Fields.Count - 1
- comfield.AddItem Data1.Recordset.Fields(x).Name
- Next x
- End Sub
-