Newly created Views not visible to Access until after pressed F5

S

Steve'o

Server = SQL Server 2000 SP3a
Client = Access 2000 SP3 data project

I have a button on a form which when clicked creates a view based on the
users selections, then opens a report who's recordsource is the newly created
view.

The name of the view contains the username, so its specific. The problem is
when the report opens it fails with:
"The record source 'vw_myusername_report' specified on this form or report
does not exist"
I think the reason is because the database window has not been refreshed,
the access client cannot see the newly created view. If I press F5 when
looking at the Views section of the database window, this refreshed it to
show the new view, and then the report works fine.

I can't predict who will be using the system, so would like for it to be
seemless, so I tried adding into the onOpen of the report
Application.RefreshDatabaseWindow
I also tried adding that to the docmd.openreport() on the onClick on the
button on the form, bu no joy. It does not refresh the window. But F5
works. But I do not want the database window to be visible to the user, and
it should be automatic.

Anyone else come accross this, or would have some suggestions as to how to
proceed?

Many thanks for any suggestions!
 
J

JaRa

Hi,

I'm not sure but can this do the trick for you?

Application.RefreshDatabaseWindow()

- Raoul
 
S

Steve'o

I did mention that I had tried this, but unfortunately it did not work.

What I've done is to use a sproc as the recordsource, and this simply
selects everything from the view vw_username.
Which is probably a better way anyway, as I can alter the sproc and it
effects everyone immediately, rather than having to send out another front
end (.adp) if any change was made to the client app.
 

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