Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar / Clock 5

Status
Not open for further replies.

sfm6s524

Programmer
Jun 18, 2003
137
0
0
US
I just finished rewriting the calendar I wrote years ago, and posted it at (2000 format). My aim was to create a calendar that I could easily distribute, and flexible enough for all the different flavors of choosing dates and times, with just 1 form and 1 module. Some of the features I built in are:

- Display a yearly calendar, not just monthly, to choose from.
- Begin week on any day, like Monday.
- Choose a date and time from one screen.
- Rounded 5 minute times for those not-so-exact times.
- Choose week beginning or week ending date.
- Click, shift-click to choose date range.
- Choose month from calendar for those mm/yyyy fields.

Feedback would be helpful, especially if it misbehaves, or perhaps to add other features.

Thanks, Ken
 
Ken,
Your calendar form looks great. I couldn't unzip the file and got this error message:
[tt]End-of-central-directory signature not found. Either this file is not a Zip file, or it constitutes one disk of a multi-part Zip file.[/tt]

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hmmm...Just tried it on another machine and it worked okay. I did replace zip file though. I guess try again and let me know.

Thanks, Ken
 
It looks great. Opens very slow (takes 3 seconds). It may be faster if you divide the time & date into different form(I think so)or month & year.

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
3 seconds! :( My 500 mhz laptop is 1...I guess I need a slower machine to develop on.

 
Mine is 1.6 ghz / P4/ Win2000. I don't know why it is slow then

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Very Nice - Runs fine for me. Answers some questions I've had for a while but have been too preoccupied to explore.

Thanks, dRahme
 
Ken

I've only had time for a quick look, so I may have missed this. What about functionality to change the date format for users not in the US. Change to dd/mm/yyyy from mm/dd/yyyy. The regional settings display different formats on your demo form, but not on the calendar itself.

Otherwise, a very nice piece of work.

HTH
Lightning
 
Good idea, I'll take a look.
 
Can't get on to the link. maybe it's just my work pc though, i'll try from home later.
 
This looks great! What would I have to change to include a 15-minute clock, in addition to (or in place of) the 5 minute display clock?

Thanks for posting this - very handy in an app I'm currently working on. Much appreciated!
 
OK, hit my first snag in trying to use the code for selecting date and time at the same time. I'm getting "Compile Error: Wrong number of arguments or invalid property assignment."

I've added fields to my form named txtDate1 and txtTime1 to test this. Here's the code:

Code:
Private Sub txtDate1_DblClick(Cancel As Integer)
Dim Date1, Time1, RetDate As Variant
  
[green]'       If you want to choose both date and time, must initialize 2 variables.[/green]
  Date1 = Nz(Me!txtDate1, 0)
  Time1 = Nz(Me!txtTime1, 0)
  RetDate = OpenCalendar(Date1 + Time1, _
                    DaySelect, _
                    Choose(Me!optDisplayMode, DisplayModeMonth, DisplayModeYear), _
                    Me!cboFirstDayOfWeek, _
                    , True)
   If IsDate(RetDate) Then
     If DateValue(RetDate) <> Nz(Me!txtDate1) Then
       Me!txtDate1 = DateValue(RetDate)
     End If
     If TimeValue(RetDate) <> Nz(Me!txtTime1) Then
       Me!txtTime1 = TimeValue(RetDate)
     End If
   End If
End Sub

Any ideas what I'm doing wrong?

---------
Kyle
 
You'll need to strip out the Demo form control names (optDisplayMode & cboFirstDayOfWeek). I did make some changes last night, which now includes a source code tab, which generates the code with your control names for the desired calendar features. Your code should be:

Dim Date1, Time1, RetDate As Variant

Date1 = DateValue(Nz(Me!txtDate1, Now))
Time1 = TimeValue(Nz(Me!txtTime1, Now))
RetDate = OpenCalendar(Date1 + Time1, DaySelect + DisplayMode5MinClock)
If IsDate(RetDate) Then
If DateValue(RetDate) <> Nz(Me!txtDate1) Then
Me!txtDate1 = DateValue(RetDate)
End If
If TimeValue(RetDate) <> Nz(Me!txtTime1) Then
Me!txtTime1 = TimeValue(RetDate)
End If
End If

I'll see what I can do on that 15 minute clock.

Ken
 
This works perfectly - I can't tell you how much time you've saved me in developing an appointment form in my app!

I'll give you another star, since my wife won't part with the first-born...

-----------
Kyle
 
Thanks. New version also has that 15 minute clock for really rounding those times.
 
Just downloaded the newest version and copied the basCalender module into my DB; however, now the minutes aren't showing up on the calendar form at all when I specify "DisplayMode15MinClock" in my dblClick event.

Any thoughts?
 
Never mind - my fault. I forgot to copy over frmCalClock from the new version.

Thanks again - just fantastic!

-------
Kyle
 
Great work! I really like the Palm-style Time Picker!

-------------------------
Just call me Captain Awesome.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top