Print Page | Close Window

Save data!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=4680
Printed Date: 22 November 2024 at 10:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Save data!
Posted By: moe188
Subject: Save data!
Date Posted: 28 July 2006 at 7:49pm
Hi,
I want to let the user select a start and end time, then enter a subject, but once the user click <Enter>, the program will ask him if he wants to save the data (display message), otherwise the selection will be deleted.
How can I do that?



Replies:
Posted By: sserge
Date Posted: 30 July 2006 at 5:27pm
Hi,

Catch EventAdded event, something like following:

Private Sub CalendarControl_EventAdded(ByVal EventID As Long)
    Dim pEvent As CalendarEvent
    Set pEvent = CalendarControl.DataProvider.GetEvent(EventID)
   
    If Not pEvent Is Nothing Then
        CalendarControl.RedrawControl
        If MsgBox("Would you like to save the data?", vbYesNo) = vbYes Then
            ' do nothing
        Else
            ' delete event
            CalendarControl.DataProvider.DeleteEvent pEvent
        End If
    End If
End Sub


--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net