M
mark_jm via AccessMonster.com
I have a refresh problem on a form.
My form is a form called "WCF-complaint update_form", containing a sub form.
The sub form has its source which is a query. Criteria in 3 of the fields in
the query comes from unbound fields on the original form ( not the sub form),
via a [Forms]![WCF-complaint update_form]![related supplier] type of
statement.
I have a refresh buitton so taht the sub form can display results based on
criteria set on the main form.
Select 3 criteria in unbound fields then refresh the sub formquery should re-
run and the sub form display the results.
The code on the refresh button looks like this.
Private Sub Command9_Click()
On Error GoTo Err_Command9_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "quality meeting wcf list_form"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.RunCommand acCmdRefresh
DoCmd.SelectObject acForm, MyForm.name, False
Exit_Command9_Click:
Exit Sub
Err_Command9_Click:
MsgBox err.Description
Resume Exit_Command9_Click
End Sub
Can any one offer advice as to why this error occurs.
Thanks
Mark
My form is a form called "WCF-complaint update_form", containing a sub form.
The sub form has its source which is a query. Criteria in 3 of the fields in
the query comes from unbound fields on the original form ( not the sub form),
via a [Forms]![WCF-complaint update_form]![related supplier] type of
statement.
I have a refresh buitton so taht the sub form can display results based on
criteria set on the main form.
Select 3 criteria in unbound fields then refresh the sub formquery should re-
run and the sub form display the results.
The code on the refresh button looks like this.
Private Sub Command9_Click()
On Error GoTo Err_Command9_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "quality meeting wcf list_form"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.RunCommand acCmdRefresh
DoCmd.SelectObject acForm, MyForm.name, False
Exit_Command9_Click:
Exit Sub
Err_Command9_Click:
MsgBox err.Description
Resume Exit_Command9_Click
End Sub
Can any one offer advice as to why this error occurs.
Thanks
Mark