p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   MS Date Time picker change (http://p2p.wrox.com/showthread.php?t=61292)

Paulys72 August 19th, 2007 08:24 PM

MS Date Time picker change
 
Hi
I'm still really new to Access and I hope I'm not wasting people's time.
The following code worked when the textbox was Date/time with an input mask but since I changed it to MS DTPicker (superiors want a pretty calendar to choose the date) it won't work. The control sources are the same and I have tried rewriting the code to include the names of the DTPickers but nothing happens. It just won't update the "status" text box.

Private Sub Final_Date_Delivered_AfterUpdate(Cancel As Integer)

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmCoordReq"

    Me![Status] = "Open"

    If ((Me![Final Date Delivered] <= Me![Date of delivery]) Or (Me![Final Date Delivered] <= Me![Date of extension])) Then

        Me![Status] = "Completed on time"

    ElseIf ((Me![Final Date Delivered] > Me![Date of delivery]) Or (Me![Final Date Delivered] > Me![Date of extension])) Then

        Me![Status] = "Completed late"

    End If

    DoCmd.Save acForm, stDocName

End Sub

Thanks

mmcdonal August 20th, 2007 06:21 AM

Is this giving you any errors, or just not working? Which date is the date picker? If it is Final_Date_Delivered, you may want to put this on the On Dirty event. Alternatively, make sure it is on the Before Update event of the form.




mmcdonal


All times are GMT -4. The time now is 01:32 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.