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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX Calendar wont respond to "On Updated"

Status
Not open for further replies.

pmo

Technical User
Jan 15, 2001
76
AU
I have an ActiveX Calendar on a form with a control source on the same form. If I change the date by clicking the calendar the only way I can have the calendar adjust the control to reflect its value is to click into the control. I want to be able to have the control change when the calendar is clicked.
The "On Updated"oesn't seem to do anything.

Can you help?

Wayne
 
I have a date control on my form and on the double click procedure, an ActiveX calendar is opened. When I double click on the calendar date, that value is entered into the control.

Also, make sure you have Microsoft AciveX Data Objects libary check in the code editor under tools/references.

If this does not answer your question, please rephrase and reask!


Private Sub DateClosed_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmCalendar"
End Sub


Judge Hopkins

"...like hunting skunks underwater...."
John Steinbeck, The Grapes of Wrath
 
And here's the code that goes onto the ActiveX calendar form (from Huffine).

Option Compare Database
Option Explicit

Private Sub actlCalendar_DblClick()
On Error GoTo Err_actlCalendar_DblClick

Dim dtmDate As Date
'To set the date control to date selected on the calendar
dtmDate = Me.ActiveControl.Value
DoCmd.Close acForm, Me.Name
Screen.ActiveControl.Value = dtmDate

Exit_actlCalendar_DblClick:
Exit Sub

Err_actlCalendar_DblClick:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_actlCalendar_DblClick

End Sub


Private Sub Command2_Click()
On Error GoTo Err_Command2_Click

Me!actlCalendar.PreviousMonth

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command2_Click
End Sub

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click

Me!actlCalendar.NextMonth

Exit_Command3_Click:
Exit Sub

Err_Command3_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command3_Click
End Sub



Private Sub Command5_Click()
On Error GoTo Err_Command5_Click

Me!actlCalendar.PreviousDay

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command5_Click
End Sub



Private Sub Command6_Click()
On Error GoTo Err_Command6_Click

Me!actlCalendar.NextDay

Exit_Command6_Click:
Exit Sub

Err_Command6_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command6_Click
End Sub


Private Sub Command8_Click()
On Error GoTo Err_Command8_Click

Me!actlCalendar.PreviousYear

Exit_Command8_Click:
Exit Sub

Err_Command8_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command8_Click
End Sub




Private Sub Command9_Click()
On Error GoTo Err_Command9_Click

Me!actlCalendar.NextYear

Exit_Command9_Click:
Exit Sub

Err_Command9_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command9_Click
End Sub

Private Sub Command11_Click()
On Error GoTo Err_Command11_Click


DoCmd.Close

Exit_Command11_Click:
Exit Sub

Err_Command11_Click:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Command11_Click

End Sub


Private Sub Form_Load()
On Error GoTo Err_Form_Load

Me!actlCalendar.Today

Exit_Form_Load:
Exit Sub

Err_Form_Load:
MsgBox "A database error occurred, please exit database, refer to manual and try again.", vbCritical, "DATABASE SYSTEM ERROR"
Resume Exit_Form_Load
End Sub


Judge Hopkins

"...like hunting skunks underwater...."
John Steinbeck, The Grapes of Wrath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top