home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form2
- 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.ComboBox comfield
- Height = 315
- Left = 1560
- Style = 2 'Dropdown List
- TabIndex = 19
- Top = 3120
- Width = 1875
- End
- Begin VB.TextBox txtcomments
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 18
- Top = 2280
- Width = 4635
- End
- Begin VB.TextBox txtsubject
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 17
- Top = 1440
- Width = 4635
- End
- Begin VB.TextBox txtnotes
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 14
- Top = 2700
- Width = 4635
- End
- Begin VB.TextBox txtdescription
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 12
- Top = 1860
- Width = 4635
- End
- Begin VB.TextBox txtpubid
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 10
- Top = 180
- Width = 855
- End
- Begin VB.TextBox txtisbn
- Height = 285
- Left = 1560
- MultiLine = -1 'True
- TabIndex = 8
- Top = 600
- Width = 1635
- End
- Begin VB.TextBox txtyear
- Height = 315
- Left = 5040
- MultiLine = -1 'True
- TabIndex = 6
- Top = 180
- Width = 855
- End
- Begin VB.CheckBox chkeof
- Caption = "EOF Reached"
- Enabled = 0 'False
- Height = 295
- Left = 2340
- TabIndex = 5
- Top = 3660
- Width = 1875
- End
- Begin VB.CheckBox chkbof
- Caption = "BOF Reached"
- Enabled = 0 'False
- Height = 295
- Left = 180
- TabIndex = 4
- Top = 3660
- Width = 1875
- End
- Begin VB.CommandButton cmdexit
- Caption = "E&xit"
- Height = 295
- Left = 5220
- TabIndex = 3
- Top = 4080
- Width = 1215
- 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 = ""
- Top = 4485
- Width = 6690
- End
- Begin VB.TextBox txttitle
- 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
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Comments"
- Height = 285
- Index = 6
- Left = 180
- TabIndex = 16
- Top = 2280
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Notes"
- Height = 285
- Index = 5
- Left = 180
- TabIndex = 15
- Top = 2700
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Description"
- Height = 285
- Index = 4
- Left = 180
- TabIndex = 13
- Top = 1860
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Pub. ID"
- Height = 285
- Index = 3
- Left = 180
- TabIndex = 11
- Top = 180
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "ISBN"
- Height = 285
- Index = 2
- Left = 180
- TabIndex = 9
- Top = 600
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Year Published"
- Height = 285
- Index = 1
- Left = 3660
- TabIndex = 7
- 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 = "Form2"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Function getfield(rs As Recordset, cfield As String) As Variant
- If IsNull(rs.Fields(cfield).Value) Then
- Select Case rs.Fields(cfield).Type
- Case dbBoolean
-
- getfield = False
-
- Case dbByte To dbDate
-
- getfield = 0
-
- Case dbLongBinary
-
- getfield = 0&
-
- Case dbMemo, dbText
-
- getfield = ""
- End Select
- getfield = rs.Fields(cfield).Value
- End If
- End Function
- Private Sub cmdexit_Click()
- Unload Form2
- Set Form2 = Nothing
- 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_Reposition()
- If Data1.Recordset.BOF = True Then
- chkbof.Value = vbChecked
- Exit Sub
- End If
- If Data1.Recordset.EOF = True Then
- chkeof.Value = vbChecked
- Exit Sub
- End If
- chkbof.Value = vbUnchecked
- chkeof.Value = vbUnchecked
- txtcomments.Text = getfield(Data1.Recordset, "comments")
- txtdescription.Text = getfield(Data1.Recordset, "description")
- txtnotes.Text = getfield(Data1.Recordset, "notes")
- txtpubid.Text = getfield(Data1.Recordset, "pubid")
- txtsubject.Text = getfield(Data1.Recordset, "subject")
- txttitle.Text = getfield(Data1.Recordset, "title")
- txtyear.Text = getfield(Data1.Recordset, "[year published]")
- txtisbn.Text = getfield(Data1.Recordset, "isbn")
- 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 "
- 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
-