P
Pete Halfacree
I am using the ActiveX Calendar to Input Dates to another
form and need to kick start the Control's AfterUpdate
Event. My current workround is using SendKeys which is
messy and unpredictable.
Does anyone have a better solution?
The Initial Forms address is passed to the Calendar Form
OpenArgs as: DoCmd.OpenForm "frmCalendar", , , , , ,
Me.Name.
After Date selection the following procedure is invoked:
Private Sub UpdateFormControl()
'If Calendar is opened from another form then
' update the active control in that form
If Not IsNull(Me.OpenArgs) Then
Me.Visible = False
For Each frm In Forms
If frm.Name = Me.OpenArgs Then
With frm
frm.Visible = True
frm.ActiveControl =
Me.ActiveControl.Object
'The next bit triggers the OnFocus Event for the Active
Control
'by simulating operator input Enter & Back Tab
'The OnFocus Event will then trigger the AfterUpdate event
if the Data has changed
.SetFocus
SendKeys "~"
SendKeys "+{TAB}"
End With
End If
Next frm
End If
DoCmd.Close acForm, "frmCalendar", acSaveNo
form and need to kick start the Control's AfterUpdate
Event. My current workround is using SendKeys which is
messy and unpredictable.
Does anyone have a better solution?
The Initial Forms address is passed to the Calendar Form
OpenArgs as: DoCmd.OpenForm "frmCalendar", , , , , ,
Me.Name.
After Date selection the following procedure is invoked:
Private Sub UpdateFormControl()
'If Calendar is opened from another form then
' update the active control in that form
If Not IsNull(Me.OpenArgs) Then
Me.Visible = False
For Each frm In Forms
If frm.Name = Me.OpenArgs Then
With frm
frm.Visible = True
frm.ActiveControl =
Me.ActiveControl.Object
'The next bit triggers the OnFocus Event for the Active
Control
'by simulating operator input Enter & Back Tab
'The OnFocus Event will then trigger the AfterUpdate event
if the Data has changed
.SetFocus
SendKeys "~"
SendKeys "+{TAB}"
End With
End If
Next frm
End If
DoCmd.Close acForm, "frmCalendar", acSaveNo