home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap29 / frm229.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-11  |  8.9 KB  |  309 lines

  1. VERSION 4.00
  2. Begin VB.Form Form2 
  3.    Caption         =   "Bound Form"
  4.    ClientHeight    =   4785
  5.    ClientLeft      =   1980
  6.    ClientTop       =   1860
  7.    ClientWidth     =   6690
  8.    Height          =   5190
  9.    Left            =   1920
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4785
  12.    ScaleWidth      =   6690
  13.    Top             =   1515
  14.    Width           =   6810
  15.    Begin VB.CommandButton cmddelete 
  16.       Caption         =   "&Delete"
  17.       Height          =   295
  18.       Left            =   1440
  19.       TabIndex        =   23
  20.       Top             =   4080
  21.       Width           =   855
  22.    End
  23.    Begin VB.CommandButton cmdupdate 
  24.       Caption         =   "&Update "
  25.       Height          =   295
  26.       Left            =   2460
  27.       TabIndex        =   22
  28.       Top             =   4080
  29.       Width           =   855
  30.    End
  31.    Begin VB.CommandButton cmdrefresh 
  32.       Caption         =   "&Refresh"
  33.       Height          =   295
  34.       Left            =   3420
  35.       TabIndex        =   21
  36.       Top             =   4080
  37.       Width           =   855
  38.    End
  39.    Begin VB.CommandButton cmdadd 
  40.       Caption         =   "&Add"
  41.       Height          =   295
  42.       Left            =   4440
  43.       TabIndex        =   20
  44.       Top             =   4080
  45.       Width           =   795
  46.    End
  47.    Begin VB.TextBox txtcomments 
  48.       DataField       =   "Comments"
  49.       DataSource      =   "Data1"
  50.       Height          =   285
  51.       Left            =   1560
  52.       MultiLine       =   -1  'True
  53.       TabIndex        =   17
  54.       Top             =   2280
  55.       Width           =   4635
  56.    End
  57.    Begin VB.TextBox txtnotes 
  58.       DataField       =   "Notes"
  59.       DataSource      =   "Data1"
  60.       Height          =   285
  61.       Left            =   1560
  62.       MultiLine       =   -1  'True
  63.       TabIndex        =   15
  64.       Top             =   2700
  65.       Width           =   4635
  66.    End
  67.    Begin VB.TextBox txtdescription 
  68.       DataField       =   "Description"
  69.       DataSource      =   "Data1"
  70.       Height          =   285
  71.       Left            =   1560
  72.       MultiLine       =   -1  'True
  73.       TabIndex        =   13
  74.       Top             =   1860
  75.       Width           =   4635
  76.    End
  77.    Begin VB.TextBox txtpubid 
  78.       DataField       =   "PubID"
  79.       DataSource      =   "Data1"
  80.       Height          =   285
  81.       Left            =   1560
  82.       MultiLine       =   -1  'True
  83.       TabIndex        =   11
  84.       Top             =   180
  85.       Width           =   855
  86.    End
  87.    Begin VB.TextBox txtisbn 
  88.       DataField       =   "ISBN"
  89.       DataSource      =   "Data1"
  90.       Height          =   285
  91.       Left            =   1560
  92.       MultiLine       =   -1  'True
  93.       TabIndex        =   9
  94.       Top             =   600
  95.       Width           =   1635
  96.    End
  97.    Begin VB.TextBox txtyear 
  98.       DataField       =   "Year Published"
  99.       DataSource      =   "Data1"
  100.       Height          =   315
  101.       Left            =   5040
  102.       MultiLine       =   -1  'True
  103.       TabIndex        =   7
  104.       Top             =   180
  105.       Width           =   855
  106.    End
  107.    Begin VB.CheckBox chkeof 
  108.       Caption         =   "EOF Reached"
  109.       Enabled         =   0   'False
  110.       Height          =   295
  111.       Left            =   2340
  112.       TabIndex        =   6
  113.       Top             =   3660
  114.       Visible         =   0   'False
  115.       Width           =   1875
  116.    End
  117.    Begin VB.CheckBox chkbof 
  118.       Caption         =   "BOF Reached"
  119.       Enabled         =   0   'False
  120.       Height          =   295
  121.       Left            =   180
  122.       TabIndex        =   5
  123.       Top             =   3660
  124.       Visible         =   0   'False
  125.       Width           =   1875
  126.    End
  127.    Begin VB.CommandButton cmdexit 
  128.       Caption         =   "E&xit"
  129.       Height          =   300
  130.       Left            =   5400
  131.       TabIndex        =   4
  132.       Top             =   4080
  133.       Width           =   795
  134.    End
  135.    Begin VB.Data Data1 
  136.       Align           =   2  'Align Bottom
  137.       BOFAction       =   1  'BOF
  138.       Caption         =   "Data Control"
  139.       Connect         =   "OBDC;DataBase= BIBLIO;UID=ADMIN;PWD=ADMIN"
  140.       DatabaseName    =   ""
  141.       EOFAction       =   2  'Add New
  142.       Exclusive       =   0   'False
  143.       Height          =   300
  144.       Left            =   0
  145.       Options         =   0
  146.       ReadOnly        =   0   'False
  147.       RecordsetType   =   0  'Table
  148.       RecordSource    =   ""
  149.       Top             =   4485
  150.       Width           =   6690
  151.    End
  152.    Begin VB.TextBox txtsubject 
  153.       DataField       =   "Subject"
  154.       DataSource      =   "Data1"
  155.       Height          =   285
  156.       Left            =   1560
  157.       MultiLine       =   -1  'True
  158.       TabIndex        =   3
  159.       Top             =   1440
  160.       Width           =   4635
  161.    End
  162.    Begin VB.TextBox txttitle 
  163.       DataField       =   "Title"
  164.       DataSource      =   "Data1"
  165.       Height          =   285
  166.       Left            =   1560
  167.       MultiLine       =   -1  'True
  168.       TabIndex        =   2
  169.       Top             =   1020
  170.       Width           =   4635
  171.    End
  172.    Begin VB.Label Label1 
  173.       Caption         =   "Order by"
  174.       Height          =   285
  175.       Index           =   7
  176.       Left            =   180
  177.       TabIndex        =   19
  178.       Top             =   3180
  179.       Visible         =   0   'False
  180.       Width           =   1215
  181.    End
  182.    Begin VB.Label Label1 
  183.       Caption         =   "Comments"
  184.       Height          =   285
  185.       Index           =   6
  186.       Left            =   180
  187.       TabIndex        =   18
  188.       Top             =   2280
  189.       Width           =   1215
  190.    End
  191.    Begin VB.Label Label1 
  192.       Caption         =   "Notes"
  193.       Height          =   285
  194.       Index           =   5
  195.       Left            =   180
  196.       TabIndex        =   16
  197.       Top             =   2700
  198.       Width           =   1215
  199.    End
  200.    Begin VB.Label Label1 
  201.       Caption         =   "Description"
  202.       Height          =   285
  203.       Index           =   4
  204.       Left            =   180
  205.       TabIndex        =   14
  206.       Top             =   1860
  207.       Width           =   1215
  208.    End
  209.    Begin VB.Label Label1 
  210.       Caption         =   "Pub. ID"
  211.       Height          =   285
  212.       Index           =   3
  213.       Left            =   180
  214.       TabIndex        =   12
  215.       Top             =   180
  216.       Width           =   1215
  217.    End
  218.    Begin VB.Label Label1 
  219.       Caption         =   "ISBN"
  220.       Height          =   285
  221.       Index           =   2
  222.       Left            =   180
  223.       TabIndex        =   10
  224.       Top             =   600
  225.       Width           =   1215
  226.    End
  227.    Begin VB.Label Label1 
  228.       Caption         =   "Year Published"
  229.       Height          =   285
  230.       Index           =   1
  231.       Left            =   3660
  232.       TabIndex        =   8
  233.       Top             =   180
  234.       Width           =   1215
  235.    End
  236.    Begin VB.Label Label2 
  237.       Caption         =   "Subject"
  238.       Height          =   285
  239.       Left            =   180
  240.       TabIndex        =   1
  241.       Top             =   1440
  242.       Width           =   1215
  243.    End
  244.    Begin VB.Label Label1 
  245.       Caption         =   "Title"
  246.       Height          =   285
  247.       Index           =   0
  248.       Left            =   180
  249.       TabIndex        =   0
  250.       Top             =   1020
  251.       Width           =   1215
  252.    End
  253. Attribute VB_Name = "Form2"
  254. Attribute VB_Creatable = False
  255. Attribute VB_Exposed = False
  256. Option Explicit
  257. Private Sub cmdadd_Click()
  258. Data1.Recordset.AddNew
  259. End Sub
  260. Private Sub cmddelete_Click()
  261. Data1.Recordset.Delete
  262. cmdrefresh_Click
  263. End Sub
  264. Private Sub cmdexit_Click()
  265. Unload Me
  266. Set form1 = Nothing
  267. End Sub
  268. Private Sub cmdrefresh_Click()
  269. Data1.Refresh
  270. End Sub
  271. Private Sub cmdupdate_Click()
  272. Data1.UpdateRecord
  273. End Sub
  274. Private Sub comfield_Click()
  275.     If Not comfield.Text = "Comments" Then
  276.         Data1.RecordSource = "select * From titles order by [" & comfield.Text & "]"
  277.         Data1.Refresh
  278.     End If
  279. End Sub
  280. Private Sub Data1_Error(DataErr As Integer, Response As Integer)
  281.     If DataErr > 0 Then
  282.         MsgBox " The Following Error Occured " & DataErr & " " & Error$
  283.         DataErr = 0
  284.     End If
  285. End Sub
  286. Private Sub Data1_Reposition()
  287. If Data1.Recordset.BOF = True Then
  288.     chkbof.Value = vbChecked
  289.     chkbof.Value = vbUnchecked
  290. End If
  291. If Data1.Recordset.EOF = True Then
  292.     chkeof.Value = vbChecked
  293.     chkeof.Value = vbUnchecked
  294. End If
  295. End Sub
  296. Private Sub Data1_Validate(Action As Integer, Save As Integer)
  297. If Save = False Then
  298.     Exit Sub
  299. End If
  300. If MsgBox(" Save Record Changed ", vbYesNo, "", "", 0) = vbNo Then
  301.     Data1.UpdateControls
  302.     Exit Sub
  303. End If
  304. 'If MsgBox(" Save Record Changed ", vbYesNo, "", "", 0) = vbNo Then
  305. '    Action = 0
  306. '    Exit Sub
  307. 'End If
  308. End Sub
  309.