VB Calendar
Hi, using Microsoft Calendar Control 9.0, is there a way to change the font or color of the Date Selectors combos?
Winston
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Problems Linking Outlook Calendar To Microsoft Calendar Control In Vb.
Hi,
For a while now I've been trying to find a way to link my outlook calendar to the microsoft calendar control in visual basic. When I click on the calendar in my program, I want it to show the appointment subject in a text box and the appointment body in a Richtext box. I'd appreciate any help?
Thanks.
Date && Calendar - Can't Print Calendar
Basically I'm trying to create a program which will print the date (day, day of the week, month, year) and the month that that day is in, mainly using the zeller congruence.
The code is below. Everything works, the zeller quantity is right, the date prints fine. The only problem I have is that I'm not sure how I should do the calendar. The Sub for the Calendar is at the bottom, and there you can see my attempt at printing it, but it didn't get anywhere.
Anyone know how I'd code it so that the calendar prints? If you want I can zip everything and attatch the file.
Thank you!
Edit: Oh and this is in Vb6.
Quote:
'Purpose: Create a program which will allow a user
' to choose a day, a month, and enter a
' year. After the data is inputted is
' collected, the date and the calendar of
' that month in that year is printed.
Option Explicit
Sub LeapYear(blnLeapYear As Boolean, intYear As Integer)
intYear = txtYear.Text
'If intYear Mod 4 = 0 Then
'blnLeapYear = True
If (intYear 100) Mod 4 = 0 Then
blnLeapYear = True
If (intYear Mod 100) Mod 4 <> 0 Then
blnLeapYear = False
End If
End If
End Sub
Sub MaxDays(intDaysInYear As Integer, intDaysInMonth As Integer)
Dim blnLeapYear As Boolean
Dim intYear As Integer
LeapYear blnLeapYear, intYear
If blnLeapYear = True Then
intDaysInYear = 366
ElseIf blnLeapYear = False Then
intDaysInYear = 365
End If
If cmbMonth.ListIndex = 0 Or cmbMonth.ListIndex = 2 Or cmbMonth.ListIndex = 4 Or cmbMonth.ListIndex = 6 Or cmbMonth.ListIndex = 7 Or cmbMonth.ListIndex = 9 Or cmbMonth.ListIndex = 11 Then
intDaysInMonth = 31
ElseIf blnLeapYear = True And cmbMonth.ListIndex = 1 Then
intDaysInMonth = 29
ElseIf cmbMonth.ListIndex = 1 And blnLeapYear = False Then
intDaysInMonth = 28
ElseIf cmbMonth.ListIndex = 3 Or cmbMonth.ListIndex = 5 Or cmbMonth.ListIndex = 8 Or cmbMonth.ListIndex = 10 Then
intDaysInMonth = 30
End If
End Sub
Private Sub cmdDisplay_Click()
Dim blnDateValidity As Boolean
Dim strDayName As String
Dim strMonthName As String
Dim intYear As Integer
Dim intDay As Integer
picCalendar.Cls
intYear = txtYear.Text
intDay = cmbDay.ListIndex + 1
Valid blnDateValidity
If blnDateValidity = True Then
DayName strDayName
MonthName strMonthName
picCalendar.Print strDayName & ", " & intDay & " " & strMonthName & " " & intYear
ElseIf blnDateValidity = False Then
MsgBox "The date you entered is not valid. Please ensure that if February, it is either the 28th or 29th depending on whether or not it is a leap year, and make sure the year is between 1600 and 2200.", vbOKOnly, "Sorry!"
End If
Calendar
End Sub
Sub Valid(blnDateValidity As Boolean)
Dim blnLeapYear As Boolean
Dim intYear As Integer
LeapYear blnLeapYear, intYear
If (cmbMonth.ListIndex = 3 Or cmbMonth.ListIndex = 5 Or cmbMonth.ListIndex = 8 Or cmbMonth.ListIndex = 10) And cmbDay.ListIndex < 30 And (intYear > 1599 And intYear < 2201) Then
blnDateValidity = True
ElseIf cmbMonth.ListIndex = 0 Or cmbMonth.ListIndex = 2 Or cmbMonth.ListIndex = 4 Or cmbMonth.ListIndex = 6 Or cmbMonth.ListIndex = 7 Or cmbMonth.ListIndex = 9 Or cmbMonth.ListIndex = 11 And (intYear > 1599 And intYear < 2201) Then
blnDateValidity = True
ElseIf cmbMonth.ListIndex = 1 And (intYear > 1599 And intYear < 2201) And cmbDay.ListIndex < 28 And blnLeapYear = False Then
blnDateValidity = True
ElseIf cmbMonth.ListIndex = 1 And (intYear > 1599 And intYear < 2201) And cmbDay.ListIndex < 29 And blnLeapYear = True Then
blnDateValidity = True
Else
blnDateValidity = False
End If
End Sub
Sub Zeller(intReturnedDay As Integer)
Dim intM As Integer
Dim intY As Integer
Dim intP As Integer
Dim intR As Integer
Dim intMonth As Integer
Dim intDay As Integer
intDay = cmbDay.ListIndex + 1
intMonth = cmbMonth.ListIndex + 1
intM = intMonth - 2
intY = Val(txtYear.Text)
If intM <= 0 Then
intM = intM + 12
intY = intY - 1
End If
intP = intY 100
intR = intY Mod 100
intReturnedDay = (intDay + (26 * intM - 2) 10 + intR + intR 4 + intP 4 + 5 * intP) Mod 7
End Sub
Sub DayName(strDayName As String)
Dim intReturnedDay As Integer
Dim intY As Integer
Zeller intReturnedDay
If intReturnedDay = 0 Then
strDayName = "Sunday"
ElseIf intReturnedDay = 1 Then
strDayName = "Monday"
ElseIf intReturnedDay = 2 Then
strDayName = "Tuesday"
ElseIf intReturnedDay = 3 Then
strDayName = "Wednesday"
ElseIf intReturnedDay = 4 Then
strDayName = "Thursday"
ElseIf intReturnedDay = 5 Then
strDayName = "Friday"
ElseIf intReturnedDay = 6 Then
strDayName = "Saturday"
End If
End Sub
Sub MonthName(strMonthName As String)
If cmbMonth.ListIndex = 0 Then
strMonthName = "January"
ElseIf cmbMonth.ListIndex = 1 Then
strMonthName = "February"
ElseIf cmbMonth.ListIndex = 2 Then
strMonthName = "March"
ElseIf cmbMonth.ListIndex = 3 Then
strMonthName = "April"
ElseIf cmbMonth.ListIndex = 4 Then
strMonthName = "May"
ElseIf cmbMonth.ListIndex = 5 Then
strMonthName = "June"
ElseIf cmbMonth.ListIndex = 6 Then
strMonthName = "July"
ElseIf cmbMonth.ListIndex = 7 Then
strMonthName = "August"
ElseIf cmbMonth.ListIndex = 8 Then
strMonthName = "September"
ElseIf cmbMonth.ListIndex = 9 Then
strMonthName = "October"
ElseIf cmbMonth.ListIndex = 10 Then
strMonthName = "November"
ElseIf cmbMonth.ListIndex = 11 Then
strMonthName = "December"
End If
End Sub
Private Sub Form_Load()
cmbMonth.ListIndex = 1
cmbDay.ListIndex = 0
txtYear.Text = 2004
End Sub
Sub Calendar()
Dim intDayCount As Integer
Dim intDayCountTwo As Integer
Dim intDay
Dim intReturnedDay As Integer
Dim intDayTwo As Integer
Zeller intReturnedDay
Print intReturnedDay
picCalendar.Print " "
picCalendar.Print "Sun Mon Tue Wed Thurs Fri Sat"
intDay = 0
If intReturnedDay = 0 Then
Loop Until intDay = 7
intDay = intDay + 1
picCalendar.Print intDay;
For intDayCountTwo = intReturnedDay + 1 To 6
intDayTwo = intDay + 7
picCalendar.Print intDayTwo;
Next intDayCountTwo
picCalendar.Print " "
Next intDayCount
End If
End Sub
I didn't se code or vbcode tags so I thought putting it in quotes was the best way to paste it.
Solar Calendar And Lunar Calendar
Dear Sir, or Madam,
I live in VietNam, the country near China.
As you know, our country uses a calendar called "Lunar Calendar", it's the same as China's calendar.
For now, I need to write a function in VB6 to convert a date in solar calendar to a date in lunar calendar and vise vera.
If you know about this, or you have any solution about this, please give me your instruction.
Please mail to me at: hoangwhm@yahoo.com
Thanks in million.
Add Pix To My Custom Calendar (not A Calendar Control)
Hey,
I'm hoping maybe someone can help me. I found this piece of code on the web (don't remember where) and I've made many adjustments to it. The only problem I'm having is I can't seem to add pictures to a date. For example, when the user double clicks on a date to add a text reminder, I would like him to also add a picture to that date. I would appreciate it if any of you could lend some help. Thanx.
NOTE:
This is a simplified version of my calendar. In the calendar in the attached zip file, I have changed the way the user changes the year (it is just a simple command button) and have deleted certain parts of the code that would have just cluttered things up for someone tryin to understand the code.
Edited by - Marce22 on 12/9/2003 1:24:33 PM
Date && Calendar - Need Help With Calendar
Basically I'm trying to create a program which will print the date (day, day of the week, month, year) and the month that that day is in, mainly using the zeller congruence.
The code is below. Everything works, the zeller quantity is right, the date prints fine. The only problem I have is that I'm not sure how I should do the calendar. The Sub for the Calendar is at the bottom, and there you can see my attempt at printing it, but it didn't get anywhere.
Anyone know how I'd code it so that the calendar prints? If you want I can zip everything and attatch the file.
Thank you!
Edit: Oh and this is in Vb6.
VB Code:
'Purpose: Create a program which will allow a user' to choose a day, a month, and enter a' year. After the data is inputted is' collected, the date and the calendar of' that month in that year is printed. Option Explicit Sub LeapYear(blnLeapYear As Boolean, intYear As Integer) intYear = txtYear.Text 'If intYear Mod 4 = 0 Then 'blnLeapYear = True If (intYear 100) Mod 4 = 0 Then blnLeapYear = True If (intYear Mod 100) Mod 4 <> 0 Then blnLeapYear = False End If End If End Sub Sub MaxDays(intDaysInYear As Integer, intDaysInMonth As Integer) Dim blnLeapYear As Boolean Dim intYear As Integer LeapYear blnLeapYear, intYear If blnLeapYear = True Then intDaysInYear = 366 ElseIf blnLeapYear = False Then intDaysInYear = 365 End If If cmbMonth.ListIndex = 0 Or cmbMonth.ListIndex = 2 Or cmbMonth.ListIndex = 4 Or cmbMonth.ListIndex = 6 Or cmbMonth.ListIndex = 7 Or cmbMonth.ListIndex = 9 Or cmbMonth.ListIndex = 11 Then intDaysInMonth = 31 ElseIf blnLeapYear = True And cmbMonth.ListIndex = 1 Then intDaysInMonth = 29 ElseIf cmbMonth.ListIndex = 1 And blnLeapYear = False Then intDaysInMonth = 28 ElseIf cmbMonth.ListIndex = 3 Or cmbMonth.ListIndex = 5 Or cmbMonth.ListIndex = 8 Or cmbMonth.ListIndex = 10 Then intDaysInMonth = 30 End If End Sub Private Sub cmdDisplay_Click() Dim blnDateValidity As BooleanDim strDayName As StringDim strMonthName As StringDim intYear As IntegerDim intDay As Integer picCalendar.Cls intYear = txtYear.TextintDay = cmbDay.ListIndex + 1 Valid blnDateValidity If blnDateValidity = True Then DayName strDayName MonthName strMonthName picCalendar.Print strDayName & ", " & intDay & " " & strMonthName & " " & intYearElseIf blnDateValidity = False Then MsgBox "The date you entered is not valid. Please ensure that if February, it is either the 28th or 29th depending on whether or not it is a leap year, and make sure the year is between 1600 and 2200.", vbOKOnly, "Sorry!"End If Calendar End Sub Sub Valid(blnDateValidity As Boolean) Dim blnLeapYear As Boolean Dim intYear As Integer LeapYear blnLeapYear, intYear If (cmbMonth.ListIndex = 3 Or cmbMonth.ListIndex = 5 Or cmbMonth.ListIndex = 8 Or cmbMonth.ListIndex = 10) And cmbDay.ListIndex < 30 And (intYear > 1599 And intYear < 2201) Then blnDateValidity = True ElseIf cmbMonth.ListIndex = 0 Or cmbMonth.ListIndex = 2 Or cmbMonth.ListIndex = 4 Or cmbMonth.ListIndex = 6 Or cmbMonth.ListIndex = 7 Or cmbMonth.ListIndex = 9 Or cmbMonth.ListIndex = 11 And (intYear > 1599 And intYear < 2201) Then blnDateValidity = True ElseIf cmbMonth.ListIndex = 1 And (intYear > 1599 And intYear < 2201) And cmbDay.ListIndex < 28 And blnLeapYear = False Then blnDateValidity = True ElseIf cmbMonth.ListIndex = 1 And (intYear > 1599 And intYear < 2201) And cmbDay.ListIndex < 29 And blnLeapYear = True Then blnDateValidity = True Else blnDateValidity = False End If End Sub Sub Zeller(intReturnedDay As Integer) Dim intM As Integer Dim intY As Integer Dim intP As Integer Dim intR As Integer Dim intMonth As Integer Dim intDay As Integer intDay = cmbDay.ListIndex + 1 intMonth = cmbMonth.ListIndex + 1 intM = intMonth - 2 intY = Val(txtYear.Text) If intM <= 0 Then intM = intM + 12 intY = intY - 1 End If intP = intY 100 intR = intY Mod 100 intReturnedDay = (intDay + (26 * intM - 2) 10 + intR + intR 4 + intP 4 + 5 * intP) Mod 7 End Sub Sub DayName(strDayName As String) Dim intReturnedDay As Integer Dim intY As Integer Zeller intReturnedDay If intReturnedDay = 0 Then strDayName = "Sunday" ElseIf intReturnedDay = 1 Then strDayName = "Monday" ElseIf intReturnedDay = 2 Then strDayName = "Tuesday" ElseIf intReturnedDay = 3 Then strDayName = "Wednesday" ElseIf intReturnedDay = 4 Then strDayName = "Thursday" ElseIf intReturnedDay = 5 Then strDayName = "Friday" ElseIf intReturnedDay = 6 Then strDayName = "Saturday" End If End Sub Sub MonthName(strMonthName As String) If cmbMonth.ListIndex = 0 Then strMonthName = "January" ElseIf cmbMonth.ListIndex = 1 Then strMonthName = "February" ElseIf cmbMonth.ListIndex = 2 Then strMonthName = "March" ElseIf cmbMonth.ListIndex = 3 Then strMonthName = "April" ElseIf cmbMonth.ListIndex = 4 Then strMonthName = "May" ElseIf cmbMonth.ListIndex = 5 Then strMonthName = "June" ElseIf cmbMonth.ListIndex = 6 Then strMonthName = "July" ElseIf cmbMonth.ListIndex = 7 Then strMonthName = "August" ElseIf cmbMonth.ListIndex = 8 Then strMonthName = "September" ElseIf cmbMonth.ListIndex = 9 Then strMonthName = "October" ElseIf cmbMonth.ListIndex = 10 Then strMonthName = "November" ElseIf cmbMonth.ListIndex = 11 Then strMonthName = "December" End If End Sub Private Sub Form_Load() cmbMonth.ListIndex = 1cmbDay.ListIndex = 0txtYear.Text = 2004 End Sub Sub Calendar() Dim intDayCount As Integer Dim intDayCountTwo As Integer Dim intDay Dim intReturnedDay As Integer Dim intDayTwo As Integer Zeller intReturnedDay Print intReturnedDay picCalendar.Print " " picCalendar.Print "Sun Mon Tue Wed Thurs Fri Sat" intDay = 0 If intReturnedDay = 0 Then Loop Until intDay = 7 intDay = intDay + 1 picCalendar.Print intDay; For intDayCountTwo = intReturnedDay + 1 To 6 intDayTwo = intDay + 7 picCalendar.Print intDayTwo; Next intDayCountTwo picCalendar.Print " " Next intDayCount End If End Sub
Calendar
Hi there I have a calendar control on my form in a frame with 2 text boxes.
What I want to do is to click in one of the text boxes and then click on the calendar and the date will automatically be placed into the text box. Therefore, calendar click event must remember which text box was clicked.
Does anyone know how to do this?
Calendar
I m using this function for a project: MCSOMCT2.OCX
I need it to give me message box when u try to get a date more then two month from todays date and less then a week e.g:
today = 01/01/2006 and if i click on date that is like 05/01/2006 it should give me message and if 02/03/2006 it should give me message.
I know how to deactivate the calendar but i want it to give me message rather then deactivating it:
Code:
Calendar.Value = Date
Calendar.MinDate = DateAdd("d", 7, Date) 'enable the calendar less then a week
Calendar.MaxDate = DateAdd("M", 2, Date) 'enable the calendar more then two months
has anyone got anything to say please do soo thanks very much....
Calendar
How can:
for example if its the first monday of the week, text box Number = 2 and if its second monday of the week text box number = 25 and if its the third monday of the week and if its the third Monday of the week text box number = 46 and soo on for just a month.
I use MCSOMCT2.OCX component in vb 6
the code i use to get number for the week:
Code:
if txtDay.text = "Sunday" then
txtNumber.text = "1"
if txtDay.text = "Monday" then
txtNumber.text = "4"
'and soo on
End if
Help With Calendar
Hi,
i need help coding a calendar on visual basic, basically i want to select a date and if its the same date as a date in a text box i want a little picture inserted onto the calendar
Private Sub Text1_Click()
If MonthView1.Value = Text1.Text Then
MonthView1.Select 'i know you cant select the day with this command but this is just an example of what i want'
'i want to then insert a picture onto the day selected'
End If
End Sub
Calendar Help
hi
i would like to know if anyone could fix up my code as i need to compile ASAP for a project.
please help.
i would like help with the open and save parts of my code
thanks
Calendar
Visual Basic 6
I added the Calendar Control 9.0 ActiveX Control to the Toolbox in VB6. Does anyone know how to have the current date highlighted when the calendar is shown upon opening? I can't seem to find out if iy can be done at design time.
Calendar In VB
how can i make a pop-up calendar for VB nd select dates on the pop-up and automatically be placed on a textbox. sorry i really don't have an idea on how to create a code for this. can anyone help me? please please...
Calendar
I need to create a calendar that shows entries in the separate days
As in, say for June 1, I want text right in the box for June 1, maybe something like "Dentist Appointment" or "Pay Club Fees", etc. etc.
It would be nice if I could connect it to a database too.
Anyone know of a control that can do this, or of a way to make one from scratch?
Vb Calendar
is there a facility in vb to add a calendar item to a form, much like the ones used on websites whereby the user must click on a calendar icon and choose a date from a pop up form?
Cheers
Calendar Help!!!!!
Hi there,
i am new to this forum and have been looking around and have been really impressed with not only the quality of help but the amount as well!!!!! I am a begginner to VB and have a Uni Project that if anyone could help me with that would be great.
I would liketo be able to display Today's date which would update itself every day according to the computers in built clock.
Just simply the date in any format in a label.
if anyone could help that would be great!!
cheers
James
Using The Calendar. ????
i want to use the calendar in VB. I am trying to create a project that is similar to a scheduler. If i click on a certain day i want the schedule for that day to populate in a text box. then if i click on another day, the textbox would clear and then that days schedule would populate in the textbox.
(ex. If i click on the 4th then something like "meeting at 2" would populate in a text box, then if i clicked in the 5th, something like "rent due") Something simlar to that. any help would be helpful. thanks
Calendar
how can I incorporate one of those little small white drop down calendars into my program...
Calendar
ok this is the problem i need to have a textbox tha will hold a date.
i want to show the calendar when the user bouble clicks the text box.
ut i dont know how to set te Calendar1 variable. odes any olne know how to do it?
Code:
Dim Calendar1 As Calendar
Private Sub Text1_DblClick()
Calendar1.Visible = True
End Sub
Note i do not want to added to the for and have it visible or not, because i want this to be a pop up window.
Calendar
Hi guys
I have 2 problems.
1. I am trying to disable/enable the calendar on Windows
Start Bar. How to do it within a VB form.
2. How to keep a VB form always on top and what ever other
forms/windows we open should be below it. This is like
keeping some ad bar always on top and it will be there as it
was opened and all other windows will be behind/below the
ad bar.
Please help me.
Help With Calendar
Let me try this again. I want to put a calendar in my program and make it were the user can add a one word text on a given day as a reference to a file stored on the users HD. Is it possible to add text to a calendar day using MS Calendar Control 8.0? Or is it possible to be able to click on a date and have lets say a Dialog box come up?
Calendar
In some programs, there is a calendar that pops out of a ComboBox-like control. Is there an easier way to do this then hooking the ComboBox? I posted the code I'm using and it works.
Code:
Private Sub Hook(hWnd As Long)
'Don't hook twice or you will
'be unable to unhook it.
If defWinProc = 0 Then
defWinProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WindowProc)
End If
End Sub
Private Sub Unhook(hWnd As Long)
If defWinProc <> 0 Then
Call SetWindowLong(hWnd, GWL_WNDPROC, defWinProc)
defWinProc = 0
End If
End Sub
The WindowProc Procedure looks like this (must be in a module):
Code:
Public Function WindowProc(ByVal hWnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
If uMsg = WM_LBUTTONDOWN Then
frmDetail.dtPick.Visible = True
frmDetail.dtPick.SetFocus
Else
WindowProc = CallWindowProc(defWinProc, hWnd, uMsg, wParam, lParam)
End If
End Function
Using VB6 Calendar In My App...
Ok, I need a little guidance here. I have 2 labels (startdate & enddate) when the user clicks on these they each open their own form w/a calendar for date input. I can get the forms to open & the calendars to be on the forms, what I need to know is how do I get clicking on a date to fill in startdate.caption or enddate.caption on the original form? I want no user input from these fields unless the dates are chosen from the calendar, which is why I didn't use a textbox.
A minor side note, I need the date to be formatted like this: 14Feb2005
Thanks guys!
Calendar?
Can someone point me to some examples on the Calendar control
Note not Month VIew or Datepicker
I am reffering to the Calendar control..
I am wanting to see examples or an example to see how to go about adding events for each day or data to be saved to that Days cell.
vbMarkO
Calendar Value
I'm new to visual basic trying to make one of those all-too-common calendar programs and I suck at it to be honest (I'm using Microsoft Calendar Control 8.0)
My problem is that I want to store the Calendar.value as a data type but when I try to want it to display the data type in a label it said "Argument not optional" so I assumed that meant that it couldn't store it as a date data type so I tried a string but that didn't work either. What form of data type do I need to store the Calendar value? Or am I doing something else wrong?
Calendar
i was wondering if anyone had any code for a simple calendar? I would like to add this to an application I am programming, hoping this could save me sometime.
thanks in advance
annie
Calendar
Ok, is this possible, and if so, how would I go about it?
A database contains name, date and job.
I have a textbox, a listbox a db control and a calendar control. What I need, is you type a name in the textbox, then click a date, it runs a query on the database and inserts each of the jobs into the listbox
Please help
Thanks
Calendar Again.
I asked a few weeks ago and got some great advise. But no matter how hard I try I can not make a way to save my entry's so they will come back in the correct day and month when I re open the Calendar or change months. I think a Data Base is without a doubt the best way to do it. But I cannot save the array and open it back up in the correct order.
I am putting a copy of what I got on here. If any of you have time to take a look at it and tell me what I need to do I would be very Grateful. When you double click on a day a input box comes up and you can add text to that day. I want to be able to save it so when you open the calendar back up it will still be there in the correct month and day.
Thanks
John
Using VB Calendar
Hi,
Im just trying to write a little app to keep me organized.
Using the standard VB controls i have added the MonthCalendar.
Does anyone know a way off adding notes or something like this to the days of the week?
Cheers
Calendar
I need a WINDOW calendar control that can enter text in the day area. So far, I have only found the Microsoft Calendar Control 11.0 but it does not have that feature.
Is there a freeware or something that is similar to this one? ctCalendar
Pop-Up Calendar
I believe I have all the code needed to pop-up a calendar in Excel 2007. However I'm having difficulty with the code that will pop-up the calendar whenenver a cell in a particular column is selected. Here's what I have:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("E:E") Then
Call OpenCalendar
End If
End Sub
When I click on a cell in column E the calendar is not opening. Here is the other code I have in the same module:
Code:
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
Unload Me
End Sub
Private Sub UserForm_Initialize()
If IsDate(ActiveCell.Value) Then
Calendar1.Value = DateValue(ActiveCell.Value)
Else
Calendar1.Value = Date
End If
End Sub
Sub OpenCalendar()
frmCalendar.Show
End Sub
Any idea what I'm doing wrong? Thanks, Dan
Calendar
Hi everyone, I have this really noob question... I am trying to use a calendar control, but I need to find out what day of the week it is because, I want to use the weekdayname function to find the name of the day... can anyone help me out...
Calendar
Hey people,
I am using the following code to draw a calendar in a mshflexgrid, all is working well, except for one thing. I want to fill in the gaps, for eg.
VB Code:
With grid .Row = 1 If m <> 12 Then For i = 1 To DateDiff("d", "01/" & m & "/" & Y, "01/" & m + 1 & "/" & Y)d = CDate("01/" & m & "/" & Y) + i - 1.Col = Weekday(d) - 1.Text = i.CellBackColor = RGB(249, 244, 185).CellFontSize = 18.CellFontName = "10 Cent Soviet" If Weekday(d) = 7 Then .Row = .Row + 1 If d = Date Then .CellForeColor = vbBlueDoEventsNext grid.Redraw = True Screen.MousePointer = vbNormalgrid.MousePointer = flexArrowExit Sub Else For i = 1 To DateDiff("d", "01/" & m & "/" & Y, "01/01/" & Y + 1)d = CDate("01/" & m & "/" & Y) + i - 1.Col = Weekday(d) - 1.Text = i.CellBackColor = RGB(249, 244, 185).CellFontSize = 18.CellFontName = "10 Cent Soviet" If Weekday(d) = 7 Then .Row = .Row + 1 If d = Date Then .CellForeColor = vbBlueDoEventsNext grid.Redraw = TrueScreen.MousePointer = vbNormalgrid.MousePointer = flexArrowExit Sub End IfEnd With
now here is a screen shot:
http://users.tpg.com.au/nick_ng/calendar.jpg
So basically, i want to fill in the gaps, prior to the start of the month and end of the month, with the days from the month before and month after?
Any help would be great!
Cheers
Calendar Help
[IMG]calendar[/IMG]
I know this is a simple question but I wanted to know how would I
1. create the form below
2. change the data in the fields to the right to reflect the
for that day.
3. what would be the most efficient way to create the
formto the right of the calendar ....should I used some type of
grid or caption and textboxes.
If image doesn't show follow this thread
Calendar
Is there a way to change colors of indivdual boxes on the calendar. I have a test that i do to see if it is a vaild date for the user to select. I want all valid dates to look green on the calendar and invalid dates to show up red on the calendar. Is this possible?
Vb Sql Calendar
Hey guys,
Could someone please take a look at this and help to discover what im doing wrong, this is really stressing me out ive spent 4 hrs on this
it keeps putting my dates out of wack, for e.g http://users.tpg.com.au/nick_ng/completecal.jpg
Please help, thanks
VB Code:
Dim i As IntegerSet con = New Connectioncon.Open "Provider=SQLOLEDB.1;User ID=sa;password=Newgen01;Data Source=NS1; Initial Catalog=ng"Set rs = New RecordsetWith MSHFlexGrid1 .Rows = 7 .FixedRows = 1 .Cols = 7 .FixedCols = 0 .Row = 0 .RowHeight(0) = 300 For i = 1 To 6 .RowHeight(i) = (.Height - .RowHeight(0) - 200) / 5.9 Next For i = 0 To 6 .ColWidth(i) = (.Width - 0) / 7 Next.Col = 0.Text = "Sunday".Col = 1.Text = "Monday".Col = 2.Text = "Tuesday".Col = 3.Text = "Wednesday".Col = 4.Text = "Thursday".Col = 5.Text = "Friday".Col = 6.Text = "Saturday" .ColAlignment = 4End With rs.Open "Select Sum(Case When delstats='Pickup' Then 1 Else 0 End) As Pickups, Sum(Case When delstats = 'Pickup' Then 0 Else 1 End) As Deliveries, datefrom From invoices where Month(datefrom) = " & cboMonth.Text & " And Year(DateFrom) = " & cboYear & " group by datefrom order by datefrom", con, adOpenKeyset, adLockReadOnly MSHFlexGrid1.Redraw = FalseWith rs .MoveFirst If Not .EOF Then Do MSHFlexGrid1.Col = Weekday(.Fields("DateFrom")) - 1 MSHFlexGrid1.Row = Int(Day(.Fields("DateFrom")) / 7) + 1 MSHFlexGrid1.Text = rs!datefrom & vbCrLf & "Pickups: " & .Fields("Pickups") & vbLf & "Deliveries: " & .Fields("Deliveries") .MoveNext Loop Until .EOF End IfEnd WithMSHFlexGrid1.Redraw = True rs.Closecon.CloseSet rs = NothingSet con = NothingMSHFlexGrid1.Visible = True
Edit: Added [vbcode][/vbcode] tags and some indenting for clarity. - Hack
MS Calendar
I'm using MS Calendar in my VB application and something strange is happening. On all computers, it shows the calendar from Sunday to Saturday but on 2 computers, it's Monday to Sunday even if I put this :
VB Code:
myCalendar.FirstDay = vbSunday
Anyone knows why?
Calendar
Is there a calendar control I can select multiple non-adjacent date? I know that with MonthView control, I can use DayBold fonction but there's not a big difference between the bold and not bold day!
The best would be a calendar that change color of certain date. Is there any?
Calendar
Can anyone help?
I need a "good" calendar Control to do the following things.
1. Select Several days in one Month.
This days could be: 1 thru 5, 15 thru 20 and 28 thru 30.
2. Display multiple months
Why My Calendar Looks Like This?
Hi,
I used MSCal.ocx when I developed this and I forgot to include it in setup package. When I instal it on other machines, I downloaded the MSCal.ocx from a couple of sites and found that my application looks like this without the dates visible. Why is this happening?
Calendar
What I'm doing is giving my people the option to select dates on the calendar and then click go!! when they click go I want to to bring up a spread sheet with the days selected on the top and "X" about of rows down the side (X must be changeable) and when I have filled in one of these rows it will show up and taken or something. Any ideas on who to start on this?? It's almost like a Availability search.
Calendar
is there a way to click on a command button
and have it open MS outlook calendar.
I think i have seen a module where you can add to your program and it will fill in the appropriate data you need in your VB program and then you click a submit button which activates MS outlook and then fills in the correct data on an email form and sends the email.
I was trying to do this with MS outlook, but with the calendar to add a new event from VB.
any suggestions
thanks in advance
annie
Calendar???
I need a control that looks like outlooks calendar, where can I find one for free or very cheap...
The functions I need are the functions for booking meetings or appoinments, the booked time blocks should be able to drag and drop.
/Smirre
MS Calendar
Hi,
I am having a problem with the calendar component, I am trying to run my compiled app on a XP computer with Office XP, but when the program is running the calender on my form does not appear but on all other computers it does. If I compile the app in the computer having the problem it works fine. I think/know this must be a Dll/OCX version problem but I have checked the
CALENDAR.OCX file versions and found them to be the same, Are there any other file to check for version missmatch other is it something else!.
Thanks for your help
Joolz
Calendar
Hi,
I am using a calendar in my vb6 program, I would like to color days in differnt colors to note certain days as special. I can not see a way of doing this, Is this beyond the cotrol and if so is there one that will do it without having to make one myself
Thanks
Joolz
MS Calendar Not In XP?
I have an app that I have been developing w/ VB6 in Windows98. I use the MS Calendar (MSCAL.ocx??) in this app. When I try to run the program in XP it errors on me saying this MSCAL.ocx can't be found. Does XP have it's own calendar .ocx file? I understand I can just ship the file with the app but I would like to know if Microsoft has a better calendar to use.
If you know of a more standard calendar function found in all windows OS then let me know.
Thanks in advance.
Calendar
VERY VERY CONFUSED..:
i'm aware of the calendar control.
but i was wondering how to start up on a prog dat does the following...
i wud hv a list of b-days maybe in a database or someothing..
whenever there is a b-day on dat day, it will be highlighted on the calendar as i scroll thru...
this is just for personal interest..and i wud really appreciate any replies.
thxs
~newbie to this forum
Calendar Day Name
How do i get the day name?
i means: If day = 11 then is monday
is there is a function?
Calendar
Can anyone tell me how to get that nifty little calendar to pop up and prompt to select a date or point me in the right direction? Is this in VB 5.0? Thanks.
|