Completely stumped. I've tried several methods. The latest one, which looked very elegant to me, is this http://www.tek-tips.com/faqs.cfm?fid=5860
The code compliles without error. I've inserted the procedure call in the "Master" form, in the OnCurrent event. Nothing happens, not even an error msg. The code is in the Master Form's module. I tried inserting it in a new, public module, but Access gave me errors. I have very little hair left to pull out. I am a VBA novice.
Code in form module:
Option Compare Database
Function IsOpenFrm(frmName As String) As Boolean
Dim cp As CurrentProject, Frms As Object
Set cp = CurrentProject()
Set Frms = cp.AllForms
If Frms.Item(frmName).IsLoaded Then
If Forms(frmName).CurrentView > 0 Then
IsOpenFrm = True
End If
End If
Set Frms = Nothing
Set cp = Nothing
End Function
Function call in OnCurrent property:
If IsOpenFirm("BranchesALLDecisionEditQForm") Then Forms!BranchesALLDecisionEditQForm.Requery End If
The two forms are initially synchronized using this code:
Public Sub ButtonOpenForm_Click()
DoCmd.OpenForm "BranchesALLDecisionEditQForm", , , "[DecisionNo]=[Forms]![JoinAllBranchesForm]![DecisionNo]"