Print Page | Close Window

What am I doing wrong

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=4740
Printed Date: 22 November 2024 at 10:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: What am I doing wrong
Posted By: moe188
Subject: What am I doing wrong
Date Posted: 04 August 2006 at 3:02pm
Hi,
okay everytime I select a date from standard monthview control, the data is retrieved from the database and displayed on the calendar control, but the calendar header always shows the default date. but once I add this line ( so the header will display the selected date from the monthview, the calendar remove all the events)
'////
Calendar.DayView.ShowDay SelectedDate
'////
Why????
 
my code (working fine until I add the line above):
 
        Do Until .EOF
        If .Fields("Rdate").Value = SelectedDate Then
            Set NewCalendar = MainFrm.Calendar.DataProvider.CreateEvent
            Dim StartTime As Date, EndTime As Date
            StartTime = DateFromString(.Fields("rtimefrom").Value, Date)
            EndTime = DateFromString(.Fields("rtimeto").Value, Date)
            NewCalendar.StartTime = StartTime
            NewCalendar.EndTime = EndTime
            NewCalendar.Subject = .Fields("rclient").Value
            If .Fields("PatStatus").Value = True Then
                NewCalendar.Label = 1
            End If
            Calendar.DataProvider.AddEvent NewCalendar
            Calendar.Populate
        End If
            .MoveNext
        Loop
 
Thank you



Replies:
Posted By: sserge
Date Posted: 04 August 2006 at 4:49pm
Hi,

Possible reasons:
* some VB error and function exit after error execution of ShowDay
Try to use err handlers like
On Error Resume next 
   Or
On Error GoTo labelErrHandler:

* May be not correct day was shown, or events where not visible due scrolling position,
or no events on that day, or some other bug.

Is this working?

Do Until .EOF
If .Fields("Rdate").Value = SelectedDate Then
Set NewCalendar = MainFrm.Calendar.DataProvider.CreateEvent
Dim StartTime As Date, EndTime As Date
StartTime = DateFromString(.Fields("rtimefrom").Value, Date)
EndTime = DateFromString(.Fields("rtimeto").Value, Date)
NewCalendar.StartTime = StartTime
NewCalendar.EndTime = EndTime
NewCalendar.Subject = .Fields("rclient").Value
If .Fields("PatStatus").Value = True Then
NewCalendar.Label = 1
End If
Calendar.DataProvider.AddEvent NewCalendar
End If
.MoveNext
Loop
Calendar.DayView.ShowDay SelectedDate
Calendar.Populate


--
WBR,
Serge



Posted By: moe188
Date Posted: 04 August 2006 at 6:20pm
No its not working,
same result, the only time the result is displayed is when I select todays date (system's date)
any idea how to fix this problem?
Thank you


Posted By: sserge
Date Posted: 07 August 2006 at 1:37pm
Did you try On Error Resume next in the beginning of the method?

--
WBR,
Serge


Posted By: moe188
Date Posted: 07 August 2006 at 5:17pm
Yes I did used "On Error Rsume Next", and still not working.


Posted By: sserge
Date Posted: 08 August 2006 at 2:13pm
Looks like I need more information to proceed with investigating this issue.
The best would be if you can create a small sample showing the problem, or attach your app (in support area).

Otherwise, try making a few screenshots and collect more information.

For example, insert some logging into this event handler, like:
Debug.Print "<event handler> Date = " & SelectedDate

--
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