|
-
November 12th, 2003, 08:11 PM
#1
some help with sheridan calendar widgets please...
hi guys,
in vb6, i have a single form.
on it, i have the following controls.
command button
SSMonth Control (sheridan)
SS Day Control (sheridan)
I have the month control displayed above the day control on the form.
The form reads and writes from an ms access database which is named "samplecalendar.mdb"
the data base has only one table which is named "Main"
this table contains the following fields:
Date - Date/Time
BeginTime - Date/Time
EndTime - Date/Time
Description - Text
What I want to do is if there is an appt on a day, i want the month calendar to be colored , checkmarked or something to indicate that there is something happening on that day., or it
would be even nicer if it just displayed a number indicating how
many things are scheduled for that day.
the code I have behind the form and controls is this:
Code:
Private Sub Command1_Click()
If SSDay1.X.Tasks.Count > 0 And SSDay1.TaskSelected > -1 Then
Data1.Recordset.MoveFirst
For i = 1 To SSDay1.TaskSelected
Data1.Recordset.MoveNext
Next i
Data1.Recordset.Delete
SSDay1.X.Tasks.Remove SSDay1.TaskSelected
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "delete task"
End Sub
Private Sub SSDay1_CloseEdit(TaskIndex As Integer, Action As Integer, cancelled As Integer, changed As Integer)
If changed And Not cancelled Then
If Action = 0 Then
Data1.Recordset.AddNew
Data1.Recordset("Date") = SSMonth1.Date
Data1.Recordset("Begintime") = SSDay1.X.Tasks(TaskIndex).BeginTime
Data1.Recordset("Endtime") = SSDay1.X.Tasks(TaskIndex).EndTime
Data1.Recordset("Description") = SSDay1.X.Tasks(TaskIndex).Text
Data1.Recordset.Update
Else
Data1.Recordset.FindFirst "Begintime = #" & SSDay1.X.Tasks(TaskIndex).BeginTime & "# and Description ='" & SSDay1.X.Tasks(TaskIndex).Text & "'"
Data1.Recordset.Edit
Data1.Recordset("Date") = SSMonth1.Date
Data1.Recordset("Begintime") = SSDay1.X.Tasks(TaskIndex).BeginTime
Data1.Recordset("Endtime") = SSDay1.X.Tasks(TaskIndex).EndTime
Data1.Recordset("Description") = SSDay1.X.Tasks(TaskIndex).Text
Data1.Recordset.Update
End If
End If
End Sub
Private Sub SSDay1_DeleteTask(RtnCancel As Integer, RtnDispPromptMsg As Integer)
Call Command1_Click
End Sub
Private Sub SSMonth1_SelChange(SelDate As String, OldSelDate As String, Selected As Integer, RtnCancel As Integer)
SSDay1.X.Tasks.RemoveAll
Data1.RecordSource = "Select * from Main where Date = #" & SelDate & "#"
Data1.Refresh
If Data1.Recordset.RecordCount > 0 Then
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
SSDay1.X.Tasks.Add Data1.Recordset("BeginTime"), Data1.Recordset("EndTime"), Data1.Recordset("Description")
Data1.Recordset.MoveNext
Loop
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|