Access-o-Mania

Access-Forum (Deutsch/German) => Access Programmierung => Thema gestartet von: boehnli01 am Oktober 09, 2011, 13:49:53

Titel: Msgbox für leeres Datumsfeld
Beitrag von: boehnli01 am Oktober 09, 2011, 13:49:53
Hallo zusammen,

In meinem Formular habe ich ein Datumsfeld, das  beim doppelclicken ein UFO aufruft. Falls kein Datum drin ist, möchte ich einen Hinweis.
Habe es mal so probiert, aber hat nicht funtioniert.
Private Sub PROD_Date_DblClick(Cancel As Integer)

If Me.PROD_Date Is Null Then
       MsgBox "No Date selcted", vbCritical
       
        Exit Sub
    End If


DoCmd.OpenForm "ufo_Cap_SO_DETAILS", , , "[PROD_Date]=" & Format(Me![PROD_Date], "\#yyyy-mm-dd\#") & " and Prod_Line ='" & Me!Prod_Line & "'"




Danke und gruss
Cédric
Titel: Re: Msgbox für leeres Datumsfeld
Beitrag von: DF6GL am Oktober 09, 2011, 13:55:10
Hallo,,


so:

Private Sub PROD_Date_DblClick(Cancel As Integer)

If IsNull(Me!PROD_Date) Then
       MsgBox "No Date selected", vbCritical
Else
       DoCmd.OpenForm "ufo_Cap_SO_DETAILS", , , "[PROD_Date]=" & Format(Me![PROD_Date], "\#yyyy-mm-dd\#") & " and Prod_Line ='" & Me!Prod_Line & "'"
End If

End Sub




btw: Was Du machst, ist das Öffnen (irgend)eines anderen Formulars.  Das hat mit einem UFO (Unterformular-Steuerelement) nichts zu tun.
Titel: Re: Msgbox für leeres Datumsfeld
Beitrag von: boehnli01 am Oktober 09, 2011, 14:03:13
Super. Danke.
Du hast Recht, kein UFO sondern ein anderes Formular.