Sheets("База").Cells(all + 1, 23) = "Нет"
Sheets("База").Cells(all + 1, 24) = "Нет"
Sheets("База").Cells(all + 1, 25) = "Нет"
Sheets("База").Cells(all + 1, 26) = "Нет"
Sheets("База").Cells(all + 1, 27) = "Нет"
Sheets("База").Cells(all + 1, 28) = "Нет"
Sheets("База").Cells(all + 1, 29) = "Ожидает"
x = MsgBox("Клиент успешно занесен в базу данных", vbInformation + vbOKOnly, "Автошкола")
AddClientForm.Hide
ClientForm.Show (0)
Else
erin:
x = MsgBox("Проверьте правильность введеных значений", vbCritical + vbOKOnly, "Автошкола")
End If
End Sub
Кнопка “Закрыть”:
Private Sub bt_exit_Click()
Список “Автомобиль”:
Private Sub cb_car_Change()
Sheets("Данные").Activate
cb_teacher.Clear
For i = 2 To 10
If Sheets("Данные").Cells(i, 4) = cb_car.Value Then cb_teacher.AddItem Sheets("Данные").Cells(i, 3)
Next i
cb_teacher.ListIndex = 0
Поле “Дом”:
Private Sub ed_home_Change()
ed_home.Text = Val(ed_home.Text)
Поле “Сотовый”:
Private Sub ed_mobile_Change()
ed_mobile.Text = Val(ed_mobile.Text)
Поле “Номер”:
Private Sub ed_num_Change()
ed_num.Text = Val(ed_num.Text)
Поле “Дом. телефон”:
Private Sub ed_phone_Change()
ed_phone.Text = Val(ed_phone.Text)
Поле “Квартира”:
Private Sub ed_room_Change()
ed_room.Text = Val(ed_room.Text)
Поле “Серия”:
Private Sub ed_ser_Change()
ed_ser.Text = Val(ed_ser.Text)
Активация формы:
Private Sub UserForm_Activate()
ed_surname.Text = ""
ed_name.Text = ""
ed_patron.Text = ""
ed_birth.Text = ""
ed_who.Text = ""
ed_date.Text = ""
ed_ser.Text = ""
ed_num.Text = ""
ed_str.Text = ""
ed_home.Text = ""
ed_room.Text = ""
ed_phone.Text = ""
ed_mobile.Text = ""
Инициализация формы:
Private Sub UserForm_Initialize()
cb_car.ListIndex = 0
cb_teacher.AddItem Cells(4, 3)
Завершение работы формы:
Private Sub UserForm_Terminate()
PayForm.Hide
Кнопка “Сформировать бланк”:
Private Sub bt_makeblank_Click()
If (ed_datepay.Text = CDate(ed_datepay.Text)) And cb_whopay.Text <> "" And ed_money.Value <> "" And ed_money.Value <> 0 Then
Sheets("Оплата").Activate
Sheets("Оплата").Range("B5").Value = cb_whopay.Value
Sheets("Оплата").Range("C8").Value = ed_datepay.Text
Sheets("Оплата").Range("C9").Value = ed_money.Text & " руб."
Sheets("Оплата").Visible = True
Кнопка “Подтвердить оплату”:
Private Sub bt_pay_Click()
Sheets("База").Activate
Sheets("База").Cells(1, 1).Select
all = Selection.CurrentRegion.Rows.Count
For i = 2 To all
If Sheets("База").Cells(i, 29) <> "Окончил" And (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4)) = cb_whopay.Text Then Cells(i, 21) = Val(Cells(i, 21)) + ed_money.Value
y = MsgBox("Оплата внесена!", vbInformation + vbOKOnly, "Автошкола")
Поле “Сумма платежа (руб.)”:
Private Sub ed_money_Change()
ed_money.Value = Val(ed_money.Value)
cb_whopay.Clear
ed_money.Value = ""
Dim x As Integer
x = 0
ed_datepay.Text = Date
If Sheets("База").Cells(i, 29) <> "Окончил" Then
cb_whopay.AddItem (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4))
x = x + 1
If x = 0 Then
y = MsgBox("Текущая группа пуста!", vbCritical + vbOKOnly, "Автошкола")
cb_whopay.ListIndex = 0
Процедура (обновление активности):
Sub endis()
level_1.Enabled = True
level_2.Enabled = True
level_3.Enabled = True
If cb_able.Value = True And cb_pdd.Value = True And cb_help.Value = True And Val(desc_howmuchdrive.Text) >= Sheets("Данные").Range("L4") And Val(desc_howmuchpay.Caption) >= Sheets("Данные").Range("L2") Then
level_1.Enabled = False
If cb_insidepdd.Value = True And cb_insidedrive.Value = True And cb_insidegorod.Value = True Then
level_2.Enabled = False
level_3.Enabled = False
Кнопка “Выйти”:
WayForm.Hide
Кнопка “Сохранить”:
Private Sub bt_save_Click()
If ComboBox1.Text = (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4)) And Sheets("База").Cells(i, 29) = "Обучаемый" Then
If cb_able.Value = True Then Sheets("База").Cells(i, 17) = "Да" Else Sheets("База").Cells(i, 17) = "Нет"
If cb_pdd.Value = True Then Sheets("База").Cells(i, 15) = "Да" Else Sheets("База").Cells(i, 15) = "Нет"
If cb_help.Value = True Then Sheets("База").Cells(i, 16) = "Да" Else Sheets("База").Cells(i, 16) = "Нет"
If cb_insidepdd.Value = True Then Sheets("База").Cells(i, 23) = "Да" Else Sheets("База").Cells(i, 23) = "Нет"
If cb_insidedrive.Value = True Then Sheets("База").Cells(i, 24) = "Да" Else Sheets("База").Cells(i, 24) = "Нет"
If cb_insidegorod.Value = True Then Sheets("База").Cells(i, 25) = "Да" Else Sheets("База").Cells(i, 25) = "Нет"
If cb_gaipdd.Value = True Then Sheets("База").Cells(i, 26) = "Да" Else Sheets("База").Cells(i, 26) = "Нет"
If cb_gaidrive.Value = True Then Sheets("База").Cells(i, 27) = "Да" Else Sheets("База").Cells(i, 27) = "Нет"
If cb_gaigorod.Value = True Then Sheets("База").Cells(i, 28) = "Да" Else Sheets("База").Cells(i, 28) = "Нет"
Sheets("База").Cells(i, 20) = desc_howmuchdrive.Text
Страницы: 1, 2, 3, 4, 5, 6, 7