Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 20th, 2005, 07:49 AM
Registered User
 
Join Date: Jan 2005
Location: Birmingham, , United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MSCAL. Calender.7

Can anyone help. I have a calender displaying each month in an access database form. The Calender however, is defaulting to a date which i have to specify. I would like a have a calender which shows the current date. (ie =now()). I am using class MSCAL.calender.7

Can anyone help??
Reply With Quote
  #2 (permalink)  
Old January 23rd, 2005, 04:21 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

check your ctl default values for example

ctl.Year = Year(Now)
ctl.Month = Month(Now)
ctl.Day = Day(Now)

this is a sample I have from my cal.

Code:
Private Sub Form_Load()
Dim lkb As String
Dim ctl As Control
Set ctl = Me!CalDate
    lkb = "[apptDate] = #" & Format(Now(), "short date") & "#"

    Me.RecordsetClone.FindFirst lkb
    If Me.RecordsetClone.NoMatch = False Then
        Me.Bookmark = Me.RecordsetClone.Bookmark
    Else
        Me.RecordsetClone.AddNew
        Me.RecordsetClone![ApptDate] = Format(Now(), "short date")
        Me.RecordsetClone.Update
        Me.RecordsetClone.MoveLast
        Me.Bookmark = Me.RecordsetClone.Bookmark
        Me![CalDate] = Format(Now(), "short date")
        Me![txtDate] = Me![CalDate]
    End If

Me.CalDate.Value = lkb
ctl.Year = Year(Now)
ctl.Month = Month(Now)
ctl.Day = Day(Now)

DoCmd.Maximize

End Sub
Jaime E. Maccou
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding Calender Button kotaiah Excel VBA 0 September 21st, 2006 07:21 AM
calender event chandrasekhar ASP.NET 2.0 Professional 1 April 16th, 2006 11:32 PM
calender crmpicco Classic ASP Basics 2 March 23rd, 2005 01:21 PM
MSCAL.OCX narendrapawar VB Components 0 December 17th, 2004 01:44 PM
Calender gmoney060 Classic ASP Basics 4 August 23rd, 2004 12:10 AM



All times are GMT -4. The time now is 12:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.