User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 397,703 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,437 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser:

Access - Calendar Control

Join Date: Apr 2007
Posts: 5
Reputation: James890 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
James890 James890 is offline Offline
Newbie Poster

Access - Calendar Control

  #1  
Apr 13th, 2007
I'm wanting to use a calendar to select dates in Access 2003 and want it to pop up when a date field is clicked on. So I will want the same calendar to pop up to be used to select a date, from many differenct date fields on the form.

I've used a variable ('originator') to pass the date field name.
But it isn't working. Could someone check my code please?

(dob is the field I want the date to go into and Calendar6 is the name of the calendar I'm using.) Here's my code:


Option Compare Database
Option Explicit
Dim originator As ComboBox
Private Sub dob_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set originator = dob
Calendar6.Visible = True
Calendar6.SetFocus
If Not IsNull(originator) Then
Calendar6.Value = originator.Value
Else
Calendar6.Value = Date
End If
End Sub
Private Sub Calendar6_Click()
originator.Value = Calendar6.Value
originator.SetFocus
Calendar6.Visible = False
Set originator = Nothing
End Sub
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 1:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC