I used Mike B's code and was able to get it to work on the double click of the field and a click of a button. now I have two date fields on the same screen... i created calendar and calendar1 for the two calendars (because I wanted to tie it into the source data)... I have the two buttons as well. here is my documentation. My issue is it pulls up the calendar for all four situations .. what code change do I need to get the first date/button (which is fine) to pull one calendar.. and the second date/button to pull the second calendar. I am using ActiveX controls....
thanks, Bobb
Private Sub ActivateCalendarForm(ByVal sCtrl As String
Dim sArgs As Strin
Dim sFullFormName As Strin
If IsSubForm(Me) = True The
sFullFormName = "SubForm" & "*" & Me.Parent.Nam
Els
sFullFormName = "Form" & "*" & Me.Nam
End I
sArgs = sFullFormName & "|" & sCtr
If IsObject(Command74) = True The
DoCmd.OpenForm "frmCalendar", , , , acFormPropertySettings, acDialog, sArg
Els
If IsObject(DateRaised) = True The
DoCmd.OpenForm "frmCalendar", , , , acFormPropertySettings, acDialog, sArg
Els
DoCmd.OpenForm "frmCalendar1", , , , acFormPropertySettings, acDialog, sArg
End I
End I
End Su
Private Function IsSubForm(fForm As Form) As Boolea
On Error GoTo HandleEr
If IsObject(fForm.Parent) The
IsSubForm = True 'The Form Passed is a Subfor
Els
IsSubForm = False 'The Form Passed is a Mainfor
End I
Exit Functio
HandleErr
IsSubForm = Fals
End Functio
Private Sub Command74_Click(
ActivateCalendarForm "DateRaised
End Su
Private Sub DateRaised_DblClick(Cancel As Integer
ActivateCalendarForm "FrmCalendar
End Su
Private Sub Text1_DblClick(Cancel As Integer
ActivateCalendarForm "Text1
End Su
Private Sub Command76_Click(
ActivateCalendarForm "DateCleared
End Su
Private Sub DateCleared_DblClick(Cancel As Integer
ActivateCalendarForm "FrmCalendar1
End Su
Private Sub Text2_DblClick(Cancel As Integer
ActivateCalendarForm "Text2
End Su