What am I doing wrong |
Post Reply |
Author | |
moe188
Senior Member Joined: 27 March 2006 Status: Offline Points: 220 |
Post Options
Thanks(0)
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
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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, Is this working?
-- WBR, Serge |
|
moe188
Senior Member Joined: 27 March 2006 Status: Offline Points: 220 |
Post Options
Thanks(0)
|
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
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Did you try On Error Resume next in the beginning of the method?
-- WBR, Serge |
|
moe188
Senior Member Joined: 27 March 2006 Status: Offline Points: 220 |
Post Options
Thanks(0)
|
Yes I did used "On Error Rsume Next", and still not working.
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |