S
Sandy
Hello -
I have a main form with a series of tabs in a tab control.
The data I am managing is for a manufacturing work flow, so most of the data
is in one table which has many fields.
I have organized the view of the data in the tab controls, using sub forms
in each tab.
Some of the fields in a sub form are based on values or calculations against
fields on another sub form. Most of the data in each of the sub forms is from
the same record.
The challenge I am facing is that when I update the data in one tab (ie a
field in the same record but in a different tab/sub-form) then move to
another tab/sub-form, the data in the new tab/sub-form is not refreshing to
show the data that was just updated in another tab.
Based on some exaples in this forum, I have created a module that would run
on the LostFocus event of every subform in every tab. I need this to refresh
the data for all the fields in the current record as well as update the data
and calculations that are on every other subform.
The function is called by:
====================
Run_RefreshForms Me.Name
====================
The function is coded as follows:
------------------------------------
Function Run_RefreshForms(MyFormName As String)
Forms![Main Form]![f_newjob].Form.Requery
Forms![Main Form]![f_newjob].Form![f_JobSumm-ContactSub].Form.Requery
Forms![Main Form]![f_QuoteSummary].Form.Requery
Forms![Main Form]![f_quote].Form.Requery
Forms![Main Form]![f_quote].Form![f_QuoteDetails SubForm].Form.Requery
MsgBox "test works!"
End Function
------------------------------------
However, nothing is happening and the Msg Text is not executing. I am sure I
have missed something simple or called the function incorrectly.
Any help would be greatly appreciated!!
Many thanks
sandra
I have a main form with a series of tabs in a tab control.
The data I am managing is for a manufacturing work flow, so most of the data
is in one table which has many fields.
I have organized the view of the data in the tab controls, using sub forms
in each tab.
Some of the fields in a sub form are based on values or calculations against
fields on another sub form. Most of the data in each of the sub forms is from
the same record.
The challenge I am facing is that when I update the data in one tab (ie a
field in the same record but in a different tab/sub-form) then move to
another tab/sub-form, the data in the new tab/sub-form is not refreshing to
show the data that was just updated in another tab.
Based on some exaples in this forum, I have created a module that would run
on the LostFocus event of every subform in every tab. I need this to refresh
the data for all the fields in the current record as well as update the data
and calculations that are on every other subform.
The function is called by:
====================
Run_RefreshForms Me.Name
====================
The function is coded as follows:
------------------------------------
Function Run_RefreshForms(MyFormName As String)
Forms![Main Form]![f_newjob].Form.Requery
Forms![Main Form]![f_newjob].Form![f_JobSumm-ContactSub].Form.Requery
Forms![Main Form]![f_QuoteSummary].Form.Requery
Forms![Main Form]![f_quote].Form.Requery
Forms![Main Form]![f_quote].Form![f_QuoteDetails SubForm].Form.Requery
MsgBox "test works!"
End Function
------------------------------------
However, nothing is happening and the Msg Text is not executing. I am sure I
have missed something simple or called the function incorrectly.
Any help would be greatly appreciated!!
Many thanks
sandra