Code Examples For RunCommand Constants

Refresh Views

acCmdViewViews

This code is an adaptation of some code that I saw on one of the newgroups. Unfortunately I do not know who posted the original code.

The code is designed to work in an ADP project to make Access aware of a new view tha thas been added to the SQL server.

'***************** Code Start *******************

Sub RefreshViews())

  Echo False
  DoCmd.SelectObject acTable, , True
  DoCmd.RunCommand acCmdViewViews
  Application.RefreshDatabaseWindow
  DoCmd.RunCommand acCmdWindowHide
  Echo False

End Sub

'****************** Code End ********************