Subform help

DanHolland

Registered User.
Local time
Today, 13:47
Joined
Feb 6, 2013
Messages
19
Hi, sorry if theres a post like this already.

i have a main form for customers and a subform for sites which is set to locked so its displayed as just a list. I have a button on my main form to add a new site for the current customer displayed...

How can i get the Main form '1CustomerDetails' with subform '2SiteList' to automatically refresh one i've clicked the save button on another form.

Thanks in Advance
 
From the save button refer to the form '1CustomerDetails' (and its subform) and force a refresh/requery.
But first check if form '1CustomerDetails' is open
Below is the code for refresh/requery the form '1CustomerDetails'.
Code:
  If SysCmd(acSysCmdGetObjectState, acForm, "1CustomerDetails") <> conObjStateClosed Then
    If Forms("1CustomerDetails").CurrentView <> conDesignView Then
      Forms("1CustomerDetails").Form.Refresh
      'or 
      'Forms("1CustomerDetails").Form.Requery
    End If
  End If
 

Users who are viewing this thread

Back
Top Bottom