ClaraBarton
Registered User.
- Local time
- Today, 02:19
- Joined
- Oct 14, 2019
- Messages
- 654
I use a dialog form to edit and add new recipes. The following code is from the calling form.
It doesn't seem to matter where I requery the treeview, it doesn't pick up the new record and throws an error. Can you suggest a better way here?
Code:
Private Sub btnEdit_Click()
On Error GoTo btnEdit_Click_Error
Me.Visible = False
DoCmd.OpenForm "frmAddEdit", _
windowmode:=acDialog, _
OpenArgs:=Me.name
'When you get back:
If CurrentProject.AllForms("frmAddEdit").IsLoaded Then
Me.Requery
' TVW.reloadTree
' faytRecipe.Requery
' faytIngredient.Requery
Me.Recordset.FindFirst "recipeid = " & Forms!frmAddEdit!recipeid
DoCmd.Close acForm, "frmAddEdit"