1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdValidate_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Records")
'find rows in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
iRow = ws.Cells(Rows.Count, 2) _
.End(xlUp).Offset(1, 0).Row
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row
iRow = ws.Cells(Rows.Count, 4) _
.End(xlUp).Offset(1, 0).Row
iRow = ws.Cells(Rows.Count, 5) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtKiny.Value
ws.Cells(iRow, 2).Value = Me.txtTermGA.Value
ws.Cells(iRow, 3).Value = Me.txtTermTseZe.Value
ws.Cells(iRow, 4).Value = Me.txtEng.Value
ws.Cells(iRow, 5).Value = Me.txtFre.Value
'clear the data
Me.txtKiny.Value = ""
Me.txtTermGA.Value = ""
Me.txtTermTseZe.Value = ""
Me.txtEng.Value = ""
Me.txtFre.Value = ""
Me.txtKiny.SetFocus
End Sub
Private Sub chkKiny_Click()
txtKiny.Enabled = (chkKiny.Value = vbChecked)
End Sub
Private Sub chkTermGa_Click()
txtTermGA.Enabled = (chkTermGa.Value = vbChecked)
End Sub
Private Sub chkTermTseZe_Click()
txtTermTseZe.Enabled = (chkTermTseZe.Value = vbChecked)
End Sub
Private Sub chkEng_Click()
txtEng.Enabled = (chkEng.Value = vbChecked)
End Sub
Private Sub chkFre_Click()
txtFre.Enabled = (chkFre.Value = vbChecked)
End Sub
Private Sub txtTermGa_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Right(txtTermGA.Text, 2) <> "ga" Then Cancel = True
End Sub
Private Sub txtTermTseZe_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If (Right(txtTermTseZe.Text, 2) <> "ze") And (Right(txtTermTseZe.Text, 3) <> "tse") And (Right(txtTermTseZe.Text, 2) <> "ye") And (Right(txtTermTseZe.Text, 2) <> "je") And (Right(txtTermTseZe.Text, 2) <> "we") And (Right(txtTermTseZe.Text, 2) <> "se") Then Cancel = True
End Sub |
Partager