home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / VISDATA / DFD.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-12  |  21.1 KB  |  653 lines

  1. VERSION 5.00
  2. Begin VB.Form frmDFD 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "
  5.    ClientHeight    =   3705
  6.    ClientLeft      =   1155
  7.    ClientTop       =   2505
  8.    ClientWidth     =   6930
  9.    HelpContextID   =   2018517
  10.    Icon            =   "DFD.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3705
  16.    ScaleWidth      =   6930
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   1  'CenterOwner
  19.    Begin VB.CommandButton cmdDown 
  20.       Height          =   540
  21.       Left            =   6285
  22.       Picture         =   "DFD.frx":030A
  23.       Style           =   1  'Graphical
  24.       TabIndex        =   16
  25.       Top             =   2295
  26.       UseMaskColor    =   -1  'True
  27.       Width           =   540
  28.    End
  29.    Begin VB.CommandButton cmdUp 
  30.       Height          =   540
  31.       Left            =   6285
  32.       Picture         =   "DFD.frx":0614
  33.       Style           =   1  'Graphical
  34.       TabIndex        =   15
  35.       Top             =   1710
  36.       UseMaskColor    =   -1  'True
  37.       Width           =   540
  38.    End
  39.    Begin VB.CommandButton cmdMoveFields 
  40.       Caption         =   "<"
  41.       BeginProperty Font 
  42.          Name            =   "
  43.          Size            =   9.75
  44.          Charset         =   134
  45.          Weight          =   400
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   375
  51.       Index           =   3
  52.       Left            =   2910
  53.       MaskColor       =   &H00000000&
  54.       TabIndex        =   7
  55.       Top             =   2745
  56.       Width           =   495
  57.    End
  58.    Begin VB.CommandButton cmdMoveFields 
  59.       Caption         =   "<<"
  60.       BeginProperty Font 
  61.          Name            =   "
  62.          Size            =   9.75
  63.          Charset         =   134
  64.          Weight          =   400
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       Height          =   375
  70.       Index           =   2
  71.       Left            =   2910
  72.       MaskColor       =   &H00000000&
  73.       TabIndex        =   6
  74.       Top             =   2295
  75.       Width           =   495
  76.    End
  77.    Begin VB.CommandButton cmdMoveFields 
  78.       Caption         =   ">>"
  79.       BeginProperty Font 
  80.          Name            =   "
  81.          Size            =   9.75
  82.          Charset         =   134
  83.          Weight          =   400
  84.          Underline       =   0   'False
  85.          Italic          =   0   'False
  86.          Strikethrough   =   0   'False
  87.       EndProperty
  88.       Height          =   375
  89.       Index           =   1
  90.       Left            =   2910
  91.       MaskColor       =   &H00000000&
  92.       TabIndex        =   5
  93.       Top             =   1845
  94.       Width           =   495
  95.    End
  96.    Begin VB.CommandButton cmdMoveFields 
  97.       Caption         =   ">"
  98.       BeginProperty Font 
  99.          Name            =   "
  100.          Size            =   9.75
  101.          Charset         =   134
  102.          Weight          =   400
  103.          Underline       =   0   'False
  104.          Italic          =   0   'False
  105.          Strikethrough   =   0   'False
  106.       EndProperty
  107.       Height          =   375
  108.       Index           =   0
  109.       Left            =   2910
  110.       MaskColor       =   &H00000000&
  111.       TabIndex        =   4
  112.       Top             =   1395
  113.       Width           =   495
  114.    End
  115.    Begin VB.ListBox lstSelected 
  116.       DragIcon        =   "DFD.frx":091E
  117.       Height          =   1530
  118.       Left            =   3510
  119.       TabIndex        =   3
  120.       Top             =   1440
  121.       Width           =   2685
  122.    End
  123.    Begin VB.CommandButton cmdBuildForm 
  124.       Caption         =   "
  125. (&B)"
  126.       Height          =   375
  127.       Left            =   3330
  128.       MaskColor       =   &H00000000&
  129.       TabIndex        =   8
  130.       Top             =   3225
  131.       Width           =   1695
  132.    End
  133.    Begin VB.ComboBox cboRecordSource 
  134.       Height          =   315
  135.       Left            =   1680
  136.       TabIndex        =   1
  137.       Top             =   480
  138.       Width           =   5010
  139.    End
  140.    Begin VB.ListBox lstAll 
  141.       DragIcon        =   "DFD.frx":0C28
  142.       Height          =   1530
  143.       Left            =   120
  144.       TabIndex        =   2
  145.       Top             =   1440
  146.       Width           =   2685
  147.    End
  148.    Begin VB.TextBox txtFormName 
  149.       Height          =   285
  150.       Left            =   2760
  151.       TabIndex        =   0
  152.       Top             =   120
  153.       Width           =   1830
  154.    End
  155.    Begin VB.CommandButton cmdClose 
  156.       Cancel          =   -1  'True
  157.       Caption         =   "
  158. (&C)"
  159.       Height          =   375
  160.       Left            =   5115
  161.       MaskColor       =   &H00000000&
  162.       TabIndex        =   9
  163.       Top             =   3225
  164.       Width           =   1695
  165.    End
  166.    Begin VB.Line Line1 
  167.       BorderWidth     =   3
  168.       X1              =   120
  169.       X2              =   6780
  170.       Y1              =   1080
  171.       Y2              =   1080
  172.    End
  173.    Begin VB.Label lblLabels 
  174.       Alignment       =   2  'Center
  175.       Caption         =   "
  176.  SQL 
  177.       Height          =   195
  178.       Index           =   2
  179.       Left            =   1680
  180.       TabIndex        =   14
  181.       Top             =   840
  182.       Width           =   5010
  183.    End
  184.    Begin VB.Label lblLabels 
  185.       AutoSize        =   -1  'True
  186.       Caption         =   "
  187.       Height          =   195
  188.       Index           =   4
  189.       Left            =   3510
  190.       TabIndex        =   13
  191.       Top             =   1200
  192.       Width           =   1170
  193.    End
  194.    Begin VB.Label lblLabels 
  195.       AutoSize        =   -1  'True
  196.       Caption         =   "
  197.       Height          =   195
  198.       Index           =   1
  199.       Left            =   105
  200.       TabIndex        =   12
  201.       Top             =   540
  202.       Width           =   1110
  203.    End
  204.    Begin VB.Label lblLabels 
  205.       AutoSize        =   -1  'True
  206.       Caption         =   "
  207.       Height          =   195
  208.       Index           =   3
  209.       Left            =   120
  210.       TabIndex        =   11
  211.       Top             =   1200
  212.       Width           =   1200
  213.    End
  214.    Begin VB.Label lblLabels 
  215.       AutoSize        =   -1  'True
  216.       Caption         =   "
  217.       Height          =   195
  218.       Index           =   0
  219.       Left            =   120
  220.       TabIndex        =   10
  221.       Top             =   120
  222.       Width           =   2100
  223.    End
  224. Attribute VB_Name = "frmDFD"
  225. Attribute VB_GlobalNameSpace = False
  226. Attribute VB_Creatable = False
  227. Attribute VB_PredeclaredId = True
  228. Attribute VB_Exposed = False
  229. Option Explicit
  230. '>>>>>>>>>>>>>>>>>>>>>>>>
  231. Const FORMCAPTION = "
  232. Const BUTTON1 = "
  233. (&B) "
  234. Const BUTTON2 = "
  235. (&C)"
  236. Const Label1 = "
  237. Const Label2 = "
  238. Const LABEL3 = "
  239.  SQL 
  240. Const LABEL4 = "
  241. Const LABEL5 = "
  242. Const MSG1 = "
  243. Const MSG2 = "
  244. Const MSG3 = "
  245. Const CTLNAME1 = "
  246. (&A)"
  247. Const CTLNAME2 = "
  248. (&D)"
  249. Const CTLNAME3 = "
  250. (&R)"
  251. Const CTLNAME4 = "
  252. (&U)"
  253. Const CTLNAME5 = "
  254. (&C)"
  255. '>>>>>>>>>>>>>>>>>>>>>>>>
  256. Dim mrecRS As Recordset
  257. Private Sub cboRecordSource_Change()
  258.   Set mrecRS = Nothing
  259.   lstAll.Clear
  260.   lstSelected.Clear
  261. End Sub
  262. Private Sub cboRecordSource_Click()
  263.   Call cboRecordSource_LostFocus
  264. End Sub
  265. Private Sub cboRecordSource_LostFocus()
  266.   On Error GoTo RSErr
  267.   Dim i As Integer
  268.   Dim fld As Field
  269.   If Len(cboRecordSource.Text) = 0 Then Exit Sub
  270.   Screen.MousePointer = 11
  271.   If mrecRS Is Nothing Then
  272.     Set mrecRS = gdbCurrentDB.OpenRecordset(cboRecordSource.Text)
  273.     For Each fld In mrecRS.Fields
  274.       lstAll.AddItem fld.Name
  275.     Next
  276.   ElseIf mrecRS.Name <> cboRecordSource.Text Then
  277.     lstAll.Clear
  278.     lstSelected.Clear
  279.     Set mrecRS = gdbCurrentDB.OpenRecordset(cboRecordSource.Text)
  280.     For Each fld In mrecRS.Fields
  281.       lstAll.AddItem fld.Name
  282.     Next
  283.   End If
  284.   If lstAll.ListCount > 0 Then lstAll.ListIndex = 0
  285.   Screen.MousePointer = 0
  286.   Exit Sub
  287. RSErr:
  288.   Screen.MousePointer = 0
  289.   MsgBox Error$
  290. End Sub
  291. Sub cmdBuildForm_Click()
  292.   If Len(txtFormName.Text) = 0 Then
  293.     MsgBox MSG1, 16
  294.     txtFormName.SetFocus
  295.     Exit Sub
  296.   End If
  297.   If Len(cboRecordSource.Text) = 0 Then
  298.     MsgBox MSG2, 16
  299.     Exit Sub
  300.   End If
  301.   If lstSelected.ListCount = 0 Then
  302.     MsgBox MSG3, 16
  303.     Exit Sub
  304.   End If
  305.   BuildForm
  306. End Sub
  307. Sub cmdClose_Click()
  308.   Unload Me
  309. End Sub
  310. Private Sub cmdDown_Click()
  311.   On Error Resume Next
  312.   Dim nItem As Integer
  313.   With lstSelected
  314.     If .ListIndex < 0 Then Exit Sub
  315.     nItem = .ListIndex
  316.     If nItem = .ListCount - 1 Then Exit Sub '
  317.     '
  318.     .AddItem .Text, nItem + 2
  319.     '
  320.     .RemoveItem nItem
  321.     '
  322.     .Selected(nItem + 1) = True
  323.   End With
  324. End Sub
  325. Private Sub cmdMoveFields_Click(Index As Integer)
  326.   Dim i As Integer
  327.   Select Case Index
  328.     Case 0
  329.       If lstAll.ListIndex < 0 Then Exit Sub
  330.       lstSelected.AddItem lstAll.Text
  331.       i = lstAll.ListIndex
  332.       lstAll.RemoveItem i
  333.       If lstAll.ListCount > 0 Then
  334.         If i > lstAll.ListCount - 1 Then
  335.           lstAll.ListIndex = i - 1
  336.         Else
  337.           lstAll.ListIndex = i
  338.         End If
  339.       End If
  340.       lstSelected.ListIndex = lstSelected.NewIndex
  341.     Case 1
  342.       For i = 0 To lstAll.ListCount - 1
  343.         lstSelected.AddItem lstAll.List(i)
  344.       Next
  345.       lstAll.Clear
  346.       lstSelected.ListIndex = 0
  347.     Case 2
  348.       For i = 0 To lstSelected.ListCount - 1
  349.         lstAll.AddItem lstSelected.List(i)
  350.       Next
  351.       lstSelected.Clear
  352.       lstAll.ListIndex = lstAll.NewIndex
  353.     Case 3
  354.       If lstSelected.ListIndex < 0 Then Exit Sub
  355.       lstAll.AddItem lstSelected.Text
  356.       i = lstSelected.ListIndex
  357.       lstSelected.RemoveItem i
  358.       
  359.       lstAll.ListIndex = lstAll.NewIndex
  360.       If lstSelected.ListCount > 0 Then
  361.         If i > lstSelected.ListCount - 1 Then
  362.           lstSelected.ListIndex = i - 1
  363.         Else
  364.           lstSelected.ListIndex = i
  365.         End If
  366.       End If
  367.   End Select
  368. End Sub
  369. Private Sub cmdUp_Click()
  370.   On Error Resume Next
  371.   Dim nItem As Integer
  372.   With lstSelected
  373.     If .ListIndex < 0 Then Exit Sub
  374.     nItem = .ListIndex
  375.     If nItem = 0 Then Exit Sub  '
  376.     '
  377.     .AddItem .Text, nItem - 1
  378.     '
  379.     .RemoveItem nItem + 1
  380.     '
  381.     .Selected(nItem - 1) = True
  382.   End With
  383. End Sub
  384. Sub Form_Load()
  385.   Me.Caption = FORMCAPTION
  386.   cmdBuildForm.Caption = BUTTON1
  387.   cmdClose.Caption = BUTTON2
  388.   lblLabels(0).Caption = Label1
  389.   lblLabels(1).Caption = Label2
  390.   lblLabels(2).Caption = LABEL3
  391.   lblLabels(3).Caption = LABEL4
  392.   lblLabels(4).Caption = LABEL5
  393.   GetTableList cboRecordSource, True, False, True
  394. End Sub
  395. Private Sub lstAll_DblClick()
  396.   cmdMoveFields_Click 0
  397. End Sub
  398. Private Sub lstSelected_DblClick()
  399.   cmdMoveFields_Click 3
  400. End Sub
  401. Sub BuildForm()
  402.   On Error GoTo BuildErr
  403.   Dim i As Integer
  404.   Dim sTmp As String
  405.   Dim nNumFlds As Integer
  406.   Dim frmNewForm As VBComponent
  407.   Dim ctlNewControl As VBControl
  408.   Dim nButtonTop As Integer
  409.   Dim bOLEFields As Boolean
  410.   nNumFlds = lstSelected.ListCount
  411.   Set frmNewForm = gVDClass.VBInstance.ActiveVBProject.VBComponents.Add(vbext_ct_VBForm)
  412.  Data 
  413.  height = 320 * numflds + 1260
  414.  width = 5640
  415.   With frmNewForm
  416.     .Properties!Appearance = 1
  417.     .Properties!Caption = Left(mrecRS.Name, 32)
  418.     .Properties!Height = 1115 + (nNumFlds * 320)
  419.     .Properties!Left = 1050
  420.     .Properties!Name = "frm" & txtFormName.Text
  421.     .Properties!Width = 5640
  422.   End With
  423.   'labels.left = 120, .width = 1815, .height = 255
  424.   'fields.left = 2040, .width = 3375, .height = 285
  425.   For i = 0 To nNumFlds - 1
  426.     sTmp = lstSelected.List(i)
  427.     Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("Label", Nothing)
  428.     With ctlNewControl
  429.       .Properties!Appearance = 1
  430.       .Properties!Caption = sTmp & ":"
  431.       .Properties!Height = 255
  432.       .Properties!Index = i
  433.       .Properties!Left = 120
  434.       .Properties!Name = "lblLabels"
  435.       .Properties!Top = (i * 320) + 60
  436.       .Properties!Width = 1815
  437.     End With
  438.     If mrecRS.Fields(sTmp).Type = 1 Then
  439.       'true/false 
  440.       Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("CheckBox", Nothing)
  441.       With ctlNewControl
  442.         .Properties!Appearance = 1
  443.         .Properties!Caption = ""
  444.         .Properties!Height = 285
  445.         .Properties!Left = 2040
  446.         .Properties!Name = "chkFields"
  447.         .Properties!Top = (i * 320) + 40
  448.         .Properties!Width = 3375
  449.         .Properties!DataSource = "Data1"
  450.         .Properties!DataField = sTmp
  451.       End With
  452.     ElseIf mrecRS.Fields(sTmp).Type = 11 Then
  453.       'picture 
  454.       bOLEFields = True
  455.       Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("OLE", Nothing)
  456.       With ctlNewControl
  457.         .Properties!Height = 285
  458.         .Properties!Left = 2040
  459.         .Properties!Name = "oleFields"
  460.         .Properties!OLETypeAllowed = 1
  461.         .Properties!Top = (i * 320) + 40
  462.         .Properties!Width = 3375
  463.         .Properties!DataSource = "Data1"
  464.         .Properties!DataField = sTmp
  465.       End With
  466.       SendKeys "{Esc}"
  467.     Else
  468.       Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("TextBox", Nothing)
  469.       With ctlNewControl
  470.         .Properties!Appearance = 1
  471.         .Properties!Left = 2040
  472.         .Properties!Name = "txtFields"
  473.         .Properties!Text = ""
  474.         If mrecRS.Fields(sTmp).Type < 10 Then
  475.           '
  476.  Date
  477.           .Properties!Width = 1935
  478.         Else
  479.           'string 
  480.  memo
  481.           .Properties!Width = 3375
  482.         End If
  483.         .Properties!DataSource = "Data1"
  484.         .Properties!DataField = sTmp
  485.         If mrecRS.Fields(sTmp).Type = 10 Then
  486.           .Properties!Height = 285
  487.           .Properties!Top = (i * 320) + 40
  488.           .Properties!MaxLength = mrecRS.Fields(sTmp).Size
  489.         ElseIf mrecRS.Fields(sTmp).Type = 12 Then
  490.           .Properties!Height = 310
  491.           .Properties!Top = (i * 320) + 30
  492.           .Properties!MultiLine = True
  493.           .Properties!ScrollBars = 2
  494.         Else
  495.           .Properties!Height = 285
  496.           .Properties!Top = (i * 320) + 40
  497.         End If
  498.       End With
  499.     End If
  500.   Next
  501.   nButtonTop = ctlNewControl.Properties!Top + 340
  502.  data 
  503.   Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("Data", Nothing)
  504.   With ctlNewControl
  505.     .Properties!Appearance = 1
  506.     .Properties!Align = 2
  507.     .Properties!Caption = ""
  508.     .Properties!DatabaseName = gdbCurrentDB.Name
  509.     .Properties!Connect = gdbCurrentDB.Connect
  510.     .Properties!RecordSource = cboRecordSource.Text
  511.   End With
  512.   Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("CommandButton", Nothing)
  513.   With ctlNewControl
  514.     .Properties!Appearance = 1
  515.     .Properties!Caption = CTLNAME1
  516.     .Properties!Height = 300
  517.     .Properties!Left = 120
  518.     .Properties!Name = "cmdAdd"
  519.     .Properties!Top = nButtonTop
  520.     .Properties!Width = 975
  521.   End With
  522.   Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("CommandButton", Nothing)
  523.   With ctlNewControl
  524.     .Properties!Appearance = 1
  525.     .Properties!Caption = CTLNAME2
  526.     .Properties!Height = 300
  527.     .Properties!Left = 1200
  528.     .Properties!Name = "cmdDelete"
  529.     .Properties!Top = nButtonTop
  530.     .Properties!Width = 975
  531.   End With
  532.   Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("CommandButton", Nothing)
  533.   With ctlNewControl
  534.     .Properties!Appearance = 1
  535.     .Properties!Caption = CTLNAME3
  536.     .Properties!Height = 300
  537.     .Properties!Left = 2280
  538.     .Properties!Name = "cmdRefresh"
  539.     .Properties!Top = nButtonTop
  540.     .Properties!Width = 975
  541.   End With
  542.   Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("CommandButton", Nothing)
  543.   With ctlNewControl
  544.     .Properties!Appearance = 1
  545.     .Properties!Caption = CTLNAME4
  546.     .Properties!Height = 300
  547.     .Properties!Left = 3360
  548.     .Properties!Name = "cmdUpdate"
  549.     .Properties!Top = nButtonTop
  550.     .Properties!Width = 975
  551.   End With
  552.   Set ctlNewControl = frmNewForm.Designer.ContainedVBControls.Add("CommandButton", Nothing)
  553.   With ctlNewControl
  554.     .Properties!Appearance = 1
  555.     .Properties!Caption = CTLNAME5
  556.     .Properties!Height = 300
  557.     .Properties!Left = 4440
  558.     .Properties!Name = "cmdClose"
  559.     .Properties!Top = nButtonTop
  560.     .Properties!Width = 975
  561.   End With
  562.   frmNewForm.CodeModule.AddFromString BuildFrmCode(bOLEFields)
  563.   txtFormName.Text = ""
  564.   cboRecordSource.Text = ""
  565.   Me.SetFocus
  566.   txtFormName.SetFocus
  567.   Exit Sub
  568. BuildErr:
  569.   MsgBox Err.Description
  570. End Sub
  571. Function BuildFrmCode(bOLEFields As Boolean) As String
  572.   Dim sCode As String
  573.   Dim i As Integer
  574.   sCode = "Private Sub cmdAdd_Click()"
  575.   sCode = sCode & vbCrLf & "  Data1.Recordset.AddNew"
  576.   sCode = sCode & vbCrLf & "End Sub"
  577.   sCode = sCode & vbCrLf
  578.   sCode = sCode & vbCrLf & "Private Sub cmdDelete_Click()"
  579.   sCode = sCode & vbCrLf & "  '
  580.   sCode = sCode & vbCrLf & "  '
  581.   sCode = sCode & vbCrLf & "  Data1.Recordset.Delete"
  582.   sCode = sCode & vbCrLf & "  Data1.Recordset.MoveNext"
  583.   sCode = sCode & vbCrLf & "End Sub"
  584.   sCode = sCode & vbCrLf
  585.   sCode = sCode & vbCrLf & "Private Sub cmdRefresh_Click()"
  586.   sCode = sCode & vbCrLf & "  '
  587.   sCode = sCode & vbCrLf & "  Data1.Refresh"
  588.   sCode = sCode & vbCrLf & "End Sub"
  589.   sCode = sCode & vbCrLf
  590.   sCode = sCode & vbCrLf & "Private Sub cmdUpdate_Click()"
  591.   sCode = sCode & vbCrLf & "  Data1.UpdateRecord"
  592.   sCode = sCode & vbCrLf & "  Data1.Recordset.Bookmark = Data1.Recordset.LastModified"
  593.   sCode = sCode & vbCrLf & "End Sub"
  594.   sCode = sCode & vbCrLf
  595.   sCode = sCode & vbCrLf & "Private Sub cmdClose_Click()"
  596.   sCode = sCode & vbCrLf & "  Unload Me"
  597.   sCode = sCode & vbCrLf & "End Sub"
  598.   sCode = sCode & vbCrLf
  599.   sCode = sCode & vbCrLf & "Private Sub Data1_Error(DataErr As Integer, Response As Integer)"
  600.   sCode = sCode & vbCrLf & "  '
  601.   sCode = sCode & vbCrLf & "  '
  602.   sCode = sCode & vbCrLf & "  '
  603.   sCode = sCode & vbCrLf & "  MsgBox ""
  604. "" & Error$(DataErr)"
  605.   sCode = sCode & vbCrLf & "  Response = 0  '
  606.   sCode = sCode & vbCrLf & "End Sub"
  607.   sCode = sCode & vbCrLf
  608.   sCode = sCode & vbCrLf & "Private Sub Data1_Reposition()"
  609.   sCode = sCode & vbCrLf & "  Screen.MousePointer = vbDefault"
  610.   sCode = sCode & vbCrLf & "  On Error Resume Next"
  611.   sCode = sCode & vbCrLf & "  '
  612.   sCode = sCode & vbCrLf & "  '
  613.   sCode = sCode & vbCrLf & "  Data1.Caption = ""
  614. "" & (Data1.Recordset.AbsolutePosition + 1)"
  615.   sCode = sCode & vbCrLf & "  '
  616.  Table 
  617.   sCode = sCode & vbCrLf & "  '
  618.  Index 
  619.   sCode = sCode & vbCrLf & "  'Data1.Caption = ""
  620. "" & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1"
  621.   sCode = sCode & vbCrLf & "End Sub"
  622.   sCode = sCode & vbCrLf
  623.   sCode = sCode & vbCrLf & "Private Sub Data1_Validate(Action As Integer, Save As Integer)"
  624.   sCode = sCode & vbCrLf & "  '
  625.   sCode = sCode & vbCrLf & "  '
  626.   sCode = sCode & vbCrLf & "  Select Case Action"
  627.   sCode = sCode & vbCrLf & "    Case vbDataActionMoveFirst"
  628.   sCode = sCode & vbCrLf & "    Case vbDataActionMovePrevious"
  629.   sCode = sCode & vbCrLf & "    Case vbDataActionMoveNext"
  630.   sCode = sCode & vbCrLf & "    Case vbDataActionMoveLast"
  631.   sCode = sCode & vbCrLf & "    Case vbDataActionAddNew"
  632.   sCode = sCode & vbCrLf & "    Case vbDataActionUpdate"
  633.   sCode = sCode & vbCrLf & "    Case vbDataActionDelete"
  634.   sCode = sCode & vbCrLf & "    Case vbDataActionFind"
  635.   sCode = sCode & vbCrLf & "    Case vbDataActionBookMark"
  636.   sCode = sCode & vbCrLf & "    Case vbDataActionClose"
  637.   sCode = sCode & vbCrLf & "  End Select"
  638.   sCode = sCode & vbCrLf & "  Screen.MousePointer = vbHourglass"
  639.   sCode = sCode & vbCrLf & "End Sub"
  640.   sCode = sCode & vbCrLf
  641.  OLE 
  642.   If bOLEFields Then
  643.     sCode = sCode & vbCrLf & "Private Sub oleFields_DblClick(Index As Integer)"
  644.     sCode = sCode & vbCrLf & "  '
  645.  data 
  646.  OLE 
  647.     sCode = sCode & vbCrLf & "  '
  648.     sCode = sCode & vbCrLf & "  oleFields(Index).InsertObjDlg"
  649.     sCode = sCode & vbCrLf & "End Sub" & vbCrLf
  650.   End If
  651.   BuildFrmCode = sCode
  652. End Function
  653.