Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - What am I doing wrong
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

What am I doing wrong

 Post Reply Post Reply
Author
Message
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Topic: What am I doing wrong
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2006 at 1:37pm
Did you try On Error Resume next in the beginning of the method?

--
WBR,
Serge
Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2006 at 5:17pm
Yes I did used "On Error Rsume Next", and still not working.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.184 seconds.