The command or action "Refresh" isnt available now

  • Thread starter mark_jm via AccessMonster.com
  • Start date
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
 
M

Mark A. Sam

Mark,

If you want to refresh the main form, remove all of the code you have and
replace it with

Me.Refresh

God Bless,

Mark A. Sam
 
M

mark_jm via AccessMonster.com

Of course... some times you just need to keep it simple... or know a smart
arse of course.

Many Thanks for this input

Mark
Mark,

If you want to refresh the main form, remove all of the code you have and
replace it with

Me.Refresh

God Bless,

Mark A. Sam
I have a refresh problem on a form.
My form is a form called "WCF-complaint update_form", containing a sub
[quoted text clipped - 42 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top