VERSION 5.00 Begin VB.Form frmNewProc BorderStyle = 3 'Fixed Dialog Caption = " New Procedure" ClientHeight = 705 ClientLeft = 45 ClientTop = 330 ClientWidth = 6945 ClipControls = 0 'False ControlBox = 0 'False Icon = "frmNewProc.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 705 ScaleWidth = 6945 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.TextBox txtName BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 345 Left = 105 MaxLength = 32 TabIndex = 0 Top = 225 Width = 4530 End Begin VB.CommandButton cbOK Caption = "&OK" Default = -1 'True BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 5865 TabIndex = 1 Top = 210 Width = 990 End Begin VB.CommandButton cbCancel Cancel = -1 'True Caption = "&Cancel" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 4785 TabIndex = 2 Top = 210 Width = 990 End Begin VB.Label Label7 Caption = "Name" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 3 Top = 15 Width = 705 End End Attribute VB_Name = "frmNewProc" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cbCancel_Click() Unload Me End Sub Private Sub cbOk_Click() Dim sName As String Dim lIndex As Long With frmNewProc ' ' Validate name ' .txtName = Trim(.txtName) If isBlank(.txtName) Then MsgBox "Procedure Name is a required field.", vbExclamation, "New Procedure" Exit Sub ElseIf Not LCase(Left(.txtName, 1)) Like "[a-z]" Then MsgBox "Procedure Name must begin with A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "New Procedure" Exit Sub Else For lChar = 1 To Len(.txtName) sChar = Mid(.txtName, lChar, 1) If Not sChar Like "[_0-9A-Za-z]" Then MsgBox "Procedure Name may only contain 0 to 9, underscore, or A to Z." & vbCrLf & "(case insensitive)", vbExclamation, "New Procedure" Exit Sub End If Next lChar End If sName = .txtName If inf.Modules("Main").Classes.Find(sName) > 0 Or _ inf.Modules("Main").Objects.Find(sName) > 0 Or _ inf.Modules("Main").Procedures.Find(sName) > 0 Then MsgBox "Name already exists.", vbExclamation, "New Procedure" Exit Sub End If inf.Modules("Main").Procedures.Add sName, "" frmMain.cbProc.AddItemAndData sName, , 4, vbBlue, , , , , , , sfProcedures frmMain.cbProc.ItemData(frmMain.cbProc.NewIndex) = inf.Modules("Main").Procedures.Count frmMain.cbProc.ListIndex = frmMain.cbProc.NewIndex End With Unload Me End Sub