Автошкола "Кадиллак"

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование

")Then">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

Else

level_3.Enabled = False

End If

Else

level_2.Enabled = False

level_3.Enabled = False

End If

End Sub

 

Кнопка “Выйти”:

Private Sub bt_exit_Click()

WayForm.Hide

ClientForm.Show (0)

End Sub

 

Кнопка “Сохранить”:

Private Sub bt_save_Click()

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

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

End If

Next i

End Sub

 

Элементы типа Checkbox:

Private Sub cb_able_Click()

Call endis

End Sub

 

Private Sub cb_help_Click()

Call endis

End Sub

 

Private Sub cb_insidedrive_Click()

Call endis

End Sub

 

Private Sub cb_insidegorod_Click()

Call endis

End Sub

 

Private Sub cb_insidepdd_Click()

Call endis

End Sub

 

Private Sub cb_pdd_Click()

Call endis

End Sub

 

Список “Клиент”:

Private Sub ComboBox1_Change()

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

If ComboBox1.Text = (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4)) And Sheets("База").Cells(i, 29) = "Обучаемый" Then

cb_able.Value = False

cb_pdd.Value = False

cb_help.Value = False

cb_insidepdd.Value = False

cb_insidedrive.Value = False

cb_insidegorod.Value = False

cb_gaipdd.Value = False

cb_gaidrive.Value = False

cb_gaigorod.Value = False

level_1.Enabled = True

level_2.Enabled = True

level_3.Enabled = True

If Sheets("База").Cells(i, 17) = "Да" Then cb_able.Value = True

If Sheets("База").Cells(i, 15) = "Да" Then cb_pdd.Value = True

If Sheets("База").Cells(i, 16) = "Да" Then cb_help.Value = True

If Sheets("База").Cells(i, 23) = "Да" Then cb_insidepdd.Value = True

If Sheets("База").Cells(i, 24) = "Да" Then cb_insidedrive.Value = True

If Sheets("База").Cells(i, 25) = "Да" Then cb_insidegorod.Value = True

If Sheets("База").Cells(i, 26) = "Да" Then cb_gaipdd.Value = True

If Sheets("База").Cells(i, 27) = "Да" Then cb_gaidrive.Value = True

If Sheets("База").Cells(i, 28) = "Да" Then cb_gaigorod.Value = True

desc_howmuchdrive.Text = Val(Cells(i, 20))

desc_howmuchpay.Caption = Val(Cells(i, 21))

Sheets("Данные").Activate

Call endis

End If

Next i

End Sub

 

Поле “Откатано часов”:

Private Sub desc_howmuchdrive_Change()

desc_howmuchdrive.Text = Val(desc_howmuchdrive.Text)

Call endis

End Sub

 

Активация формы:

Private Sub UserForm_Activate()

Dim first, hod As Integer

hod = 0

first = 0

ComboBox1.Clear

cb_able.Value = False

cb_pdd.Value = False

cb_help.Value = False

cb_insidepdd.Value = False

cb_insidedrive.Value = False

cb_insidegorod.Value = False

cb_gaipdd.Value = False

cb_gaidrive.Value = False

cb_gaigorod.Value = False

level_1.Enabled = True

level_2.Enabled = True

level_3.Enabled = True

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

If Sheets("База").Cells(i, 29) = "Обучаемый" Then

hod = hod + 1

If hod = 1 Then first = i

ComboBox1.AddItem (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4))

End If

Next i

If first <> 0 Then

i = first

If Sheets("База").Cells(i, 17) = "Да" Then cb_able.Value = True

If Sheets("База").Cells(i, 15) = "Да" Then cb_pdd.Value = True

If Sheets("База").Cells(i, 16) = "Да" Then cb_help.Value = True

If Sheets("База").Cells(i, 23) = "Да" Then cb_insidepdd.Value = True

If Sheets("База").Cells(i, 24) = "Да" Then cb_insidedrive.Value = True

If Sheets("База").Cells(i, 25) = "Да" Then cb_insidegorod.Value = True

If Sheets("База").Cells(i, 26) = "Да" Then cb_gaipdd.Value = True

If Sheets("База").Cells(i, 27) = "Да" Then cb_gaidrive.Value = True

If Sheets("База").Cells(i, 28) = "Да" Then cb_gaigorod.Value = True

desc_howmuchdrive.Text = Val(Sheets("База").Cells(i, 20))

desc_howmuchpay.Caption = Val(Sheets("База").Cells(i, 21))

Sheets("Данные").Activate

Call endis

ComboBox1.ListIndex = 0

Else

y = MsgBox("Текущая группа пуста!", vbCritical + vbOKOnly, "Автошкола")

WayForm.Hide

ClientForm.Show (0)

End If

End Sub

 

Завершение работы формы:

Private Sub UserForm_Terminate()

ClientForm.Show (0)

End Sub

5.9 Форма “Информация о клиенте”

Кнопка “ОК”:

Private Sub bt_ok_Click()

""Then">If ComboBox1.Text <> "" Then

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

If ComboBox1.Text = (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & &