Hallo Zusammen,
ich möchte eine Datumsauswahl per Kalender einfügen, das hat auch geklappt allerdings bringt er mir immer den Laufzeitfehler 2424 wenn ich den Kalender öffne. Habt ihr eine Lösung? Anbei mal mein VBA:
Option Compare Database
Option Explicit
Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' Unhide the calendar and give it the focus
ocxCalendar.Visible = True
ocxCalendar.SetFocus
' Match calendar date to existing date if present or today's date
If Not IsNull(cboStartDate) Then
ocxCalendar.Value = cboStartDate.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub ocxCalendar_Click()
' Copy chosen date from calendar to originating combo box
cboStartDate.Value = ocxCalendar.Value
' Return the focus to the combo box and hide the calendar and
cboStartDate.SetFocus
ocxCalendar.Visible = False
End Sub
Vielen Dank
Liebe Grüsse
knorrfix
Hallo,
wie lautet die Fehlerbeschreibung?
Vermutlich kann während des Mousedown-Ereignisses nicht der Fokus verschoben werden.