ClaraBarton
Registered User.
- Local time
- Today, 10:39
- Joined
- Oct 14, 2019
- Messages
- 661
I'm using the PeterHibbs with Majp Calendar in my Cookbook for menu planning. I'd like to Add a Recipe on click to the appointment form. The onclick calls the main calendar and then the appointment and then fills in the recipe and the ID. So OpenArgs needs to go thru 2 forms.
Is this the right way? From the Recipe:
From the open event of the main calendar:
And finally on the load event of the Appointment form:
It doesn't work but I'll keep plugging if I'm on the right track.
Is this the right way? From the Recipe:
Code:
DoCmd.OpenForm "frmCalendarMain", _
View:=acNormal, _
DataMode:=acFormAdd, _
OpenArgs:="me.recipe|" & Me.recipeid
Code:
DoCmd.OpenForm "frmCalendarAppt", _
View:=acNormal, _
DataMode:=acFormAdd, _
WindowMode:=acDialog, _
OpenArgs:=OpenArgs
Code:
Private Sub Form_Load()
Dim intPos As Integer
Dim strValue1 As String
Dim strValue2 As String
If Len(Me.OpenArgs) > 0 Then
intPos = InStr(Me.OpenArgs, "|")
If intPos > 0 Then '10
strValue1 = Left$(Me.OpenArgs, intPos - 1) ' "me.recipe"
strValue2 = Mid$(Me.OpenArgs, intPos + 1) ' "1328"
End If
End If
Me.txtRecipe = strValue1
Me.RecipeNo = strValue2
End Sub