How to create the calender in MDI form without using vbBuilt in Calender Function 
Author Message
 How to create the calender in MDI form without using vbBuilt in Calender Function

First off, sending attachments increases the size of your message
considerably.  Some people, (reading these newsgroups) pay for each
minute they are online, large messages take a while to download.

If you mean to send example code, reduce your problem to as few lines
as is necessary and send only that code, not an entire project.  

Now for the questions:

Quote:

> 1 ) I tried to use menu control array eith Month menu but I got lost so
> then I tried the easy method just to click on each month menu and get
> there name . I am also checking the leap year in February month menu.

Try the control array method again, that was a better way to go.
Simply RENAME your 'month' menu items to an identical name (mnuMonths)
and increase the Index value for each one.  You will then end up with
an event looking like:

Private Sub mnuMonths_Click(Index As Integer)

The index parameter will tell you which menu item (0 - 11) was clicked
on.  You can use that to generate the name of the month:

Dim MonthNames

MonthNames = Array(January, February, March, April, May, June, _
             July, August, September, October, November, December)

SelectedMonth = MonthNames(Index)
'or
gstrMonth = MonthNames(Index)

Something similar would also work for your Years menu, only;

Private Sub mnuYears_Click(Index As Integer)
    'When 1999 is the first one listed in the menu;
    gstrYear = CStr(1999 + Index)
End Sub

The reason you want to use the control array is to reduce the
amount of repeated code.  I am sure you can see these two will
replace a lot of code you cut and pasted....

Quote:
> So now my question is how can I concatenate three different variable in
> a single variable which will represent first day of a
> selected month and selected year ....?

Make a string containing the Day, Month, and Year and assign that to a Date
variable:

Dim indate as Date

indate = CDate("01 " & gstrMonth & " " & gstrYear)  

Quote:
> 3) My third problem is in the File  ---> Clear All menu where I am
> trying to remove all the collection of child form
> that is also not working.

Dim XForm As Form
On Error Resume Next
For Each XForm In Forms
    If XForm.MDIChild Then Unload XForm
Next

Have fun!
LFS



Sat, 22 Sep 2001 03:00:00 GMT  
 How to create the calender in MDI form without using vbBuilt in Calender Function

Quote:

>Hi Every body

>I am quite lost with a MDI application. I am trying to create the
>calender in the child form after selecting a year and a month
>in the Year and month menu on the parent form.

Take a good look at the MSFlexGrid control. It can easily be made into a
calendar. Treat the calendar form as an object with a read only property Get
in a class module and you can create and show calendars for any month of any
year using combo boxes on your Parent form to choose the date criteria. When
the functions to get the information are encapsulated you can spawn many
calendars with different dates with no ambiguity.
Use the ListIndex or Item data, or tag properties of the combo boxes to set
this up. Using date-diff with  the first of one month compared with the
first of the next you can determine the number of days in any month.
 Including Leap year), use the WeekDay function to determine the first day
of the first week of your chosen month and you know where to start your
calendar (grid) population using the Col property.  Set your fixed row(0) to
the days of the week, format your grid so the cells are square, increase the
font size and right-center align it and you have one nice calendar.
I used this solution in an appointment book app that tied these calendars to
a database object that upon launch any dates(cells) in the grid that had
appointments would change color, upon which when clicked would display the
DB record for that appointment (s) in another form. The visual aspect of
watching the Grid cells change to reflect appointment-filled dates was
pleasing to the user.

Just a suggestion I have the source in VB 5 sp3 if you'd like a snippet to
get you started.

-Odin.



Wed, 26 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to create appointment calender from calender in VB

2. Creating TouchScreen Outlook Calender

3. creating event in other persons calender

4. HowTo create Outlook calender items from VBScript

5. Filter Querry on Subform using calender control

6. Answer Paramater Querry Using Calender Control

7. Calender forms

8. Using the calender control

9. MDI interface without a MDI form?

10. Calender formatted reports

11. Calender

12. Linking from webpage to Outlook calender

 

 
Powered by phpBB® Forum Software