Form Refresh

  • Thread starter Thread starter Allan Koodray
  • Start date Start date
A

Allan Koodray

I have a form with the following parameters:

1 main form based on a query
2 tabs (subforms) that include the following:
New Employee Entry (new data inputs)
Employee Headcount (edits / deletions)
the subforms are linked to the main form by department.

The concept is to have a user add new employees in the
first tab, then on the second tab check during which
months the employee will be employed.

The problem I am having is the second tab (employee
Headcount) is not updated (real time) when the information
is added. The user must exit the form and re-enter to view
the new employee on the "Employee Headcount" subform. I am
sure there is vba code for refreshing the Employee
Headcount subform.
 
That solved the initial problem but created a second
problem.

The first tab is intended to be data input ONLY. When the
macro refreshes the 2nd tab, it displays an existing
record on the first tab. The properties of the first
subform are set to no additions, no deletions, data entry
= yes. Any way to resolve this one?

Allan
 
The Requery of the 2nd Subform got nothing to do with the first Subform.
Besides, the Event you used meant that you could not see the first Subform.
You must have some GUI action *after* so that you see the first Subform
again.

I would suggest that some other (Event) code in your Form / Subform
combination that changes the behaviour of your first Subform which is not
related to the Requery of the 2nd Subform.
 
I pplied the action to the tab object, so that when ANY of
the tabs are selected the forms are refreshed. It does not
work when I apply the action to the specific button
itself. Therefore, the actions of the 2nd form would be
directly related to that of the first form as both are
grouped on the same tab.

Allan
 
I am not sure what you meant.

In my original reply, I advise to re-query the appropriate *Subform*, i.e.
the HeadCount Subform.
 
OK OK I finally got it. I was using the incorrect syntax.
Rather than specifying which form to update I was using a
global Forms.refresh. By changing to Me.Name.Requery I was
able to accomplish exactly what I was looking for. Thanks
for your assistance and persistance.

Allan Koodray
 
Back
Top