When I first built the form, it had a single subform, some textfields and some buttons.
To insert data into the textfields and into the subform, I used Dialogboxes that were executed by the main form buttons.
When the user filled the Dialogbox fields and pressed the button save, the form execute the SQL statement and the main form was reloaded.
Code: Select all
Sub DIALOG_SAVE_BUTTON()
...
Dim StrSQL As String
StrSQL = "UPDATE ""TABLE_1"" ..."
Statement = ExecuteQuery(StrSQL)
Dialog.EndExecute()
Form.Reload
End Sub
However, I needed to insert another subform into the Main Form.
That was the start of my problems.
When I created the second subform the line "Form.Reload" stop working.
Few days ago I find out that the reload method works only if you focus the form.
Thus, for the subforms it works ok. I change the focus for the subforms, run the reload method and the rows are refreshed.
Somethin like this:
Code: Select all
Function RELOAD_ALL_FORMS()
...
DocumentView.getControl(SUB_FORM_1_GRID).setFocus()
CtlSUB_FORM_1.Reload
DocumentView.getControl(SUB_FORM_2_GRID).setFocus()
CtlSUB_FORM_2.Reload
Form.Reload
End Function
The interest thing is that if I create a button in the main form to execute the function "RELOAD_ALL_FORMS", the form is reloaded after cliking it for a couple of times.
But I don't want this button. I want to reload the form automatically!!
What am I doing wrong??
Please Help me!