EasyCFM.COM ColdFusion Forums / MS Access Related Issues / Access - Calendar Control (need code to popup)

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Access - Calendar Control (need code to popup)

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

James890
04-12-2007 @ 10:09 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 13
Joined: Apr 2007

I'm trying to use a calendar in Access 2003 to enter data in data fields.
I found a site that showed how to write the code so it will popup when you click on the date field and then disappear when you select the date from the calendar.
I got it working but I want to be able to access that same calendar for other date fields on the form.
So I used a variable call 'originator' to pass the originators name to the variable.
Only thing is...now it doesn't work. I get a type mismatch error and I don't know why. It's exactly the same as the example I found(obviously with my names substituted in).

Please help. (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


James890
04-14-2007 @ 5:28 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 13
Joined: Apr 2007

<RESOLVED>


Website Designed and Developed by Pablo Varando.