Forumleden,
Als ik onderstaande code uitvoer in het bijgevoegde bestand, krijg ik de melding, bij verandering van datum in het kalender-element:
"Alleen opmerkingen staan na End Sub, End Function of End Property"
Ik heb de code al doorgezocht, maar kan nergens een fout ontdekken.
Wie ziet em wel ??
Alvast bedankt
Als ik onderstaande code uitvoer in het bijgevoegde bestand, krijg ik de melding, bij verandering van datum in het kalender-element:
"Alleen opmerkingen staan na End Sub, End Function of End Property"
Ik heb de code al doorgezocht, maar kan nergens een fout ontdekken.
Wie ziet em wel ??
Code:
Private Sub UserForm_Initialize()
FillTrainingCombo
For i = 1 To 2
Me("OptionButton" & i) = vbNullString
Next
End Sub
Private Sub FillTrainingCombo()
With Me.ComboBox3
.Clear
.AddItem ("BLS/AED")
.AddItem ("PBLS/AED")
If Me.ComboBox2.Value = "Arts(-assistent)" Then .AddItem ("ALS/AED")
End With
End Sub
Private Sub ComboBox2_Click()
FillTrainingCombo
End Sub
Private Sub TextBox3_AfterUpdate()
If Not TextBox3.Value Like "######" Then
MsgBox "Een geldig Microsectienummer bestaat uit 6 cijfers !!!"
TextBox3.Value = vbNullString
End If
End Sub
Private Sub TextBox3_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case Is <= 47: KeyAscii = 0
Case 48 To 57: 'numbers 0 to 9
Case 58 To 122: KeyAscii = 0
Case Else: KeyAscii = 0
End Select
End Sub
Private Sub Calendar1_Click()
With Sheets("Data").Range("J2") = Calendar1.Value
ActiveCell.NumberFormat = "dd/mm/yyyy"
End With
End Sub
Private Sub CommandButton1_Click()
With Sheets("Database")
lRow = .Range("L300").End(xlUp).Offset(1).Row
For i = 1 To 1
.Cells(lRow, i + 0) = Me("Combobox" & i).Value
Next
For i = 1 To 2
.Cells(lRow, i + 1) = Me("TextBox" & i).Value
Next
For i = 2 To 2
.Cells(lRow, i + 3) = Me("Combobox" & i).Value
Next
For i = 3 To 3
.Cells(lRow, i + 3) = Me("Textbox" & i).Value
Next
For i = 4 To 4
.Cells(lRow, i + 4) = Me("Textbox" & i).Value
Next
For i = 3 To 3
.Cells(lRow, i + 6) = Me("Combobox" & i).Value
Next
.Cells(Rows.Count, 4).End(xlUp).Offset(1).Resize(, 1).Value = WorksheetFunction.Transpose(Sheets("Data").Range("H2").Value)
.Cells(Rows.Count, 7).End(xlUp).Offset(1).Resize(, 1).Value = WorksheetFunction.Transpose(Sheets("Data").Range("J2").Value)
End With
MsgBox "Waarden zijn opgeslagen in de database!", vbOKOnly
For i = 1 To 4
Me("TextBox" & i) = vbNullString
Next
For i = 1 To 3
Me("ComboBox" & i) = vbNullString
Next
For i = 1 To 2
Me("OptionButton" & i) = vbNullString
Next
End Sub
Alvast bedankt
Bijlagen
Laatst bewerkt: