Samanthars
07-19-2018, 01:06 PM
Im still learning am are new to trying to write code for a database i need a bit of help as it keep coming up with Compile error: Else with out if
Private Sub AddButton_Click()
If DeptOptionButton5.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Ovine Slaughter").Cells(Sheets("Ovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton6.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Ovine Boning").Cells(Sheets("Ovine Boning").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton7.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Stock Yards Beef").Cells(Sheets("Stock Yards Beef").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton8.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Bovine Slaughter").Cells(Sheets("Bovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton9.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Bovine Boning").Cells(Sheets("Bovine Boning").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton4.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Stock Yard Lamb").Cells(Sheets("Stock Yard Lamb").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton10.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Offal").Cells(Sheets("Offal").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton6.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Compliance").Cells(Sheets("Compliance").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton3.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("CMPI").Cells(Sheets("CMPI").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton2.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Salt shed").Cells(Sheets("Salt shed").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton4.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Freezers").Cells(Sheets("Freezers").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton5.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Trades").Cells(Sheets("Trades").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton7.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Admin").Cells(Sheets("Admin").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton9.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Managers").Cells(Sheets("Managers").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton8.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Supervisors").Cells(Sheets("Supervisors").Range("Z1"), 4) = DateTextBox.Value
End If
End If
MsgBox "New Worker training added."
End If
End If
End Sub
Private Sub AddButton_Click()
If DeptOptionButton5.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Ovine Slaughter").Cells(Sheets("Ovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton6.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Ovine Boning").Cells(Sheets("Ovine Boning").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton7.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Stock Yards Beef").Cells(Sheets("Stock Yards Beef").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton8.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Bovine Slaughter").Cells(Sheets("Bovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton9.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Bovine Boning").Cells(Sheets("Bovine Boning").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If DeptOptionButton4.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Stock Yard Lamb").Cells(Sheets("Stock Yard Lamb").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton10.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Offal").Cells(Sheets("Offal").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton6.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Compliance").Cells(Sheets("Compliance").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton3.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("CMPI").Cells(Sheets("CMPI").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton2.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Salt shed").Cells(Sheets("Salt shed").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton4.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Freezers").Cells(Sheets("Freezers").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton5.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Trades").Cells(Sheets("Trades").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton7.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Admin").Cells(Sheets("Admin").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton9.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Managers").Cells(Sheets("Managers").Range("Z1"), 4) = DateTextBox.Value
End If
Else
If OptionButton8.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Supervisors").Cells(Sheets("Supervisors").Range("Z1"), 4) = DateTextBox.Value
End If
End If
MsgBox "New Worker training added."
End If
End If
End Sub