"
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
ComboBox1.Enabled = False
ComboBox2.Enabled = False
ComboBox3.Enabled = False
CommandButton3.Enabled = False
CommandButton4.Enabled = False
CommandButton1.Enabled = True
CommandButton2.Enabled = TrueSubSub UserForm_Initialize ()
Workbooks ("Firms"). Unprotect Password: = "Firms1"
ActiveSheet.Unprotect Password: = "list" SubSub UserForm_QueryClose (Cancel As Integer, CloseMode As Integer)
If Cancel = 0 Then ex = 0Sub
// Workbook (Firms.xls) Форма frmEditFirm
Option Compare Textptemp As StringSub cmbOK_Click ()
Dim SA (1 To 7) As Integer
SA (1) = InStr (txtNaim.Text, ":")
SA (2) = InStr (txtNaim.Text, "/")
SA (3) = InStr (txtNaim.Text, "")
SA (4) = InStr (txtNaim.Text, "?")
SA (5) = InStr (txtNaim.Text, "*")
SA (6) = InStr (txtNaim.Text, "[")
SA (7) = InStr (txtNaim.Text, "]")
n = Len (txtNaim.Text)
For i = 1 To 7
If SA (i)> 0 Or n> 31 Then
MsgBox "Ім'я повинно бути не більше 31 знака. І не містити символів:/? * [] ", VbOKOnly," Помилка! "p> Exit Sub
End If
Next i
temp = ActiveSheet.Name
If txtNaim.Text = "" Then
MsgBox "Найменування не може бути порожнім!", vbCritical, "Помилка"
Exit Sub
End If
For Each Sheet In Workbooks ("Firms.xls"). Worksheets
If Sheet.Name = frmEditFirm.txtNaim.Text And Sheet.Name <> temp Then fl = 1
Next Sheet
If fl = 1 Then
MsgBox "У базі є фірма з таким ім'ям!", vbCritical, "Помилка!"
Exit Sub
End If
Me.HideSubSub UserForm_Activate ()
Workbooks ("Firms"). Unprotect Password: = "Firms1"
ActiveSheet.Unprotect Password: = "list"
lblNaim.ControlTipText = _
"Ім'я повинно бути не більше 31 знака. І не містити символів:/? * [] "p> End Sub
Private Sub UserForm_Deactivate ()
txtNaim.Text = ""
txtAdr.Text = ""
txtTel1.Text = ""
txtTel2.Text = ""
txtSite.Text = "" SubSub UserForm_Initialize ()
Workbooks ("Firms"). Unprotect Password: = "Firms1"
ActiveSheet.Unprotect Password: = "list" SubSub UserForm_QueryClose (Cancel As Integer, CloseMode As Integer)
If Cancel = 0 Then ex = 0Sub
// Workbook (Firms.xls) Форма frmNewPut
Option Compare Texttemp As IntegerSub CommandButton1_Click ()
Label1.Enabled = True
Label2.Enabled = True
TextBox1.Enabled = True
TextBox2.Enabled = True
CommandButton4.Enabled = False
CommandButton3.Enabled = True
CommandButton1.Caption = "Додати путівку" & Chr (13) & "(нова країна і місто)-вибрано"
CommandButton2.Caption = "Додати путівку (нове місто)"
ComboBox1.Enabl...