Hi,
I Have three comboboxes called "År", "Månad" And "Dag". I want "Dag" depend on the values from the other two comboboxes. The first code works for "Dag" depending on "År", then I added an And statement to include "Månad" but after that it doesnt work. Anyone knows what the error is?
Thanks for your help
I Have three comboboxes called "År", "Månad" And "Dag". I want "Dag" depend on the values from the other two comboboxes. The first code works for "Dag" depending on "År", then I added an And statement to include "Månad" but after that it doesnt work. Anyone knows what the error is?
Code:
Private Sub År_Change()
Dim j As Integer
Application.EnableEvents = False
Dag.Clear
Application.EnableEvents = True
For j = 0 To 100 Step 4
If År = 2016 + j Then
Call Månad_skottår
End If
Next j
End Sub
Code:
Private Sub År_Change()
Dim j As Integer
Application.EnableEvents = False
Dag.Clear
Application.EnableEvents = True
For j = 0 To 100 Step 4
If År = 2016 + j Then And Me.År.Value = "Februari"
Call Månad_skottår
End If
Next j
End Sub
Thanks for your help
Last edited: