ClaraBarton
Registered User.
- Local time
- Yesterday, 18:13
- Joined
- Oct 14, 2019
- Messages
- 578
Code:
Private Sub btnClose_Click()
10 On Error GoTo btnClose_Click_Error
Dim frm1 As Access.Form
20 DoCmd.Close _
objectType:=acForm, _
ObjectName:=Me.name
30 Select Case CallingForm
Case Is = "frmCalendarAppt"
40 Set frm1 = Forms("frmCalendarAppt")
50 frm1!txtRecipe.Value = Me.txtRecipe.Value
60 frm1!txtNotes.Value = Me.txtPrepNotes.Value
70 Exit Sub
80 Case Is = ""
90 DoCmd.OpenForm "frmMenu"
100 Exit Sub
110 Case Else
Dim frm As Form
120 For Each frm In Application.Forms
130 If frm.name = CallingForm Then
140 frm.Visible = True
150 Exit For
160 End If
170 Next frm
180 End Select
190 On Error GoTo 0
200 Exit Sub
btnClose_Click_Error:
210 MsgBox "Error " & Err.Number & " (" & Err.description & ") " & _
" in procedure btnClose_Click, line " & Erl & "."
End Sub
I've tried Forms!frmCalendarAppt. and every other way I can imagine. How do I carry the edited fields back to the calling form?