I am trying (unsuccessfully) to open a form from another form by passing a date argument.
On the first form:
Code:
Public Sub OpenAppointmentForm(vStartDate As Date)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDayCalendarMC"
stLinkCriteria = vStartDate
MsgBox (stLinkCriteria)
DoCmd.OpenForm stDocName, , , stLinkCriteria
This seems to work OK, as I get a message box with the correct date.
The Load event for the second form is:
Code:
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Me.txtDate = Me.OpenArgs
Else
MsgBox "No argument passed"
'-- Nothing passed, just open on the 1st record
End If
End Sub
I get the message that no argument was passed.
I'm trying to set Me.txtDate on my second form to the date of the passed argument.
Any help would be greatly appreciated....thanks!