How to requery a sub subform when close a different form (1 Viewer)

chrisjames25

Registered User.
Local time
Today, 12:52
Joined
Dec 1, 2014
Messages
401
Hi. PReviously you guys have assisted me in requering a subform in a loaded form when i close another form. Works great.

For example i have MainForm with a SubMainform which lists different products. On the mainform there is an add button that pops up another form - AddForm.

When i close add form the following code is triggered on the addform:

Code:
Private Sub Form_Close()
   Const FN As String = "Mainform"
   If CurrentProject.AllForms(FN).IsLoaded Then Forms(FN).RequerySubforms
End Sub

Then within the main form there is the following code:

Code:
Public Sub RequerySubforms()
   Me.Child43.Requery
  
End Sub

This requeries my list in subform and the world is happy - until now.

I now have the situation where i have a:

Mainform
SubMainform
Sub-Submainform

My question is, how do i adapt my code to requery the sub-subform when i close the Addform.

Cheers in advance
 

chrisjames25

Registered User.
Local time
Today, 12:52
Joined
Dec 1, 2014
Messages
401
Worked like a charm Minty.

All bookmarked now.

Many thanks for speedy response.
 

isladogs

MVP / VIP
Local time
Today, 12:52
Joined
Jan 14, 2017
Messages
18,211
Was this for your navigation form & if so is it now AOK?
 

chrisjames25

Registered User.
Local time
Today, 12:52
Joined
Dec 1, 2014
Messages
401
Hi Ridders.

Following your advice yesterday i abandoned the nav form and built my own which now works just like the nav form but with my limited knowledge is proving easier for me to crack on with and keep developing my stock system.
 

isladogs

MVP / VIP
Local time
Today, 12:52
Joined
Jan 14, 2017
Messages
18,211
Congratulations.
In the end, you are probably better off creating your own form with the look and feel of the navigation form but without its idiosyncrasies.

The other 'ready made' form I recommend you avoid is the split form

Keep on 'cracking on' :D
 

Users who are viewing this thread

Top Bottom