T
Tom
Hello:
I have a form ("frmCorrespondence") that has a date combo (DocumentDate).
When clicking on the combo, DocumentDate calls another form (frmCalendar).
On the frmCalendar, I have a calendar object (btw, the reason why I bring
up the calendar via another form is because I have different worksheets that
also needs to bring up the same calendar).
I utilized Stephen Leban's method (http://www.lebans.com/openform.htm) to
"position" a form based on the position of the control that calls the
subform.
The following is the original process (calendar object resides directly on
the same worksheet; Visible = False when opening the main form).
1. Click on DocumentDate
2. Calendar object pops up
3. I select a date
4. DocumentDate combo is updated w/ the selected date
Now, after having made the changes to accomodate Stephen's approach, the
following is (is not) happening:
1. Click on DocumentDate
2. Calendar object pops up (actually "frmCalendar" w/ the calendar object
3. I select a date
4. DocumentDate combo is NOT updated
Below are the 2 sets of functions (Original & Changed versions). Does
anyone know as to how I can pass on the value from "frmCalendar.Calendar" to
"frmCorrespondence.DocumentDate"?
Thanks so much in advance,
Tom
======= OriginalFunctions=============
Private Sub DocumentDate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
' Show Calendar and set its date.
Calendar.Visible = True
Calendar.SetFocus
' Set to today if DocumentDate has no value.
Calendar.Value = IIf(IsNull(DocumentDate), Date, DocumentDate.Value)
End Sub
Private Sub Calendar_Click()
' Set OrderDate to the selected date and hide the calendar.
DocumentDate.Value = Calendar.Value
DocumentDate.SetFocus
Calendar.Visible = False
End Sub
======= OriginalFunctions=============
******* ChangedFunctions*************
Private Sub DocumentDate_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim blRet As Boolean
blRet = PositionFormRelativeToControl("frmCalendar",
Forms![frmCorrespondence].[DocumentDate], 2)
Forms![frmCalendar].[Calendar].Value =
IIf(IsNull(Forms![frmCorrespondence].[DocumentDate]), Date,
Forms![frmCorrespondence].DocumentDate].Value)
End Sub
*******************************************
Private Sub Calendar_Click()
DocumentDate.Value = Forms![frmCalendar].[Calendar].Value
DocumentDate.SetFocus
Forms![frmCalendar].[Calendar].Visible = False
End Sub
******* ChangedFunctions*************
I have a form ("frmCorrespondence") that has a date combo (DocumentDate).
When clicking on the combo, DocumentDate calls another form (frmCalendar).
On the frmCalendar, I have a calendar object (btw, the reason why I bring
up the calendar via another form is because I have different worksheets that
also needs to bring up the same calendar).
I utilized Stephen Leban's method (http://www.lebans.com/openform.htm) to
"position" a form based on the position of the control that calls the
subform.
The following is the original process (calendar object resides directly on
the same worksheet; Visible = False when opening the main form).
1. Click on DocumentDate
2. Calendar object pops up
3. I select a date
4. DocumentDate combo is updated w/ the selected date
Now, after having made the changes to accomodate Stephen's approach, the
following is (is not) happening:
1. Click on DocumentDate
2. Calendar object pops up (actually "frmCalendar" w/ the calendar object
3. I select a date
4. DocumentDate combo is NOT updated
Below are the 2 sets of functions (Original & Changed versions). Does
anyone know as to how I can pass on the value from "frmCalendar.Calendar" to
"frmCorrespondence.DocumentDate"?
Thanks so much in advance,
Tom
======= OriginalFunctions=============
Private Sub DocumentDate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
' Show Calendar and set its date.
Calendar.Visible = True
Calendar.SetFocus
' Set to today if DocumentDate has no value.
Calendar.Value = IIf(IsNull(DocumentDate), Date, DocumentDate.Value)
End Sub
Private Sub Calendar_Click()
' Set OrderDate to the selected date and hide the calendar.
DocumentDate.Value = Calendar.Value
DocumentDate.SetFocus
Calendar.Visible = False
End Sub
======= OriginalFunctions=============
******* ChangedFunctions*************
Private Sub DocumentDate_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim blRet As Boolean
blRet = PositionFormRelativeToControl("frmCalendar",
Forms![frmCorrespondence].[DocumentDate], 2)
Forms![frmCalendar].[Calendar].Value =
IIf(IsNull(Forms![frmCorrespondence].[DocumentDate]), Date,
Forms![frmCorrespondence].DocumentDate].Value)
End Sub
*******************************************
Private Sub Calendar_Click()
DocumentDate.Value = Forms![frmCalendar].[Calendar].Value
DocumentDate.SetFocus
Forms![frmCalendar].[Calendar].Visible = False
End Sub
******* ChangedFunctions*************