Hey all - been making a Form today with multiple subforms in - lots of feilds need dates entering, so trawled the net and bastardised various VBA code to make a single Calendar form that is activated upon double-clicking the required field. - All good to here!!
Problem is that I want to be able to parse the date back to the field upon double clicking the required date. And when I do double-click it debugs to the line
telling me that
As stated before - the VBA is not mine, but I have worked my way through to this point OK, but please understand that I am a complete noob to VBA in Access (I'm sure that'll be obvious in a mo
anyway).
Module Code
Form_Calendar Code
Form_Student_Tracking Code
Form_Comments_subform Code
I also guess that the last line in the Comments subform is going to be a problem as it doesn't contain a close command, but I can't get on to that until I understand where I've mucked up already LOL!
Any help appreciated!
Bird
Problem is that I want to be able to parse the date back to the field upon double clicking the required date. And when I do double-click it debugs to the line
Code:
Form_Student_Tracking!Status_subform!Withdrawal_Date = MiniCal.Value
Code:
Form_Student_Tracking!Status_subform!Withdrawal_Date = <Object Required>
Module Code
Code:
Option Compare Database
Global GCalSource As String
Global GCalDate As Date
Sub GetDate(pObject As Object)
If IsNull(pObject) Then
GCalDate = Date
Else
GCalDate = pObject
End If
End Sub
Code:
Private Sub MiniCal_DblClick()
'Set date in source object
Select Case GCalSource
Case "Withdrawal_Date_subform"
Form_Student_Tracking!Status_subform!Withdrawal_Date = MiniCal.Value
End Select
'close form
DoCmd.Close acForm, "Calendar"
End Sub
Private Sub Form_Load()
MiniCal.Value = GCalDate
DoCmd.RepaintObject acForm, "Calendar"
End Sub
Code:
Option Compare Database
Private Sub Form_Open(Cancel As Integer)
End Sub
Code:
Option Compare Database
Private Sub Date_DblClick(Cancel As Integer)
GCalSource = "Date_subform"
GetDate [Date]
DoCmd.OpenForm "Calendar", acNormal, , , acFormAdd, acDialog
End Sub
Any help appreciated!
Bird