How to open a table or query on top while in a form

B

Bill Murphy

I would like to open a table or query while in a form, and have the table or
query appear on top so I can view/edit its contents. But when I use the
following code the forms reappear instantly and the table or query is not
visible. Also, the app is frozen, and the user can't exit. The task has to
be ended.

Any thoughts will be appreciated.

Bill
_____________________________________________

Private Sub cmdOpenLocalTable_Click()

Me.Visible = False
Forms!frmMain.Form.Visible = False

DoCmd.OpenTable Me!cboLocalTables, acViewNormal

Me.Visible = True
Forms!frmMain.Form.Visible = True

End Sub
 
S

Steve Schapel

Bill,

I can't figure out the purpose of the Visible = False and True stuff in
your code. But what happens if you remove all of this, and simply have
the one OpenTable line?

By the way, I should also mention that according to local wisdom, tables
and query datasheets are normally regarded as being out of bounds for
human consumption. They are ususally best regarded as background data
storage facilities. For data viewing/editing purposes, you may want to
consider opening another form rather than the table.
 
B

Bill Murphy

Steve,

The reason I would like to open these tables and queries in "raw" mode is
that my application is running on a Citrix server, and I do not have
administrative rights on the server to open tables and queries for
inspection and possibly edit. The form in my example below is hidden except
for an administrator in my Access app, so the everyday user will never see
this.

Apparently the tables and queries are opening, but behind any open forms
since I can see them once I shut down the app. The visible = false and
visible = true in my example were an attempt on my part to hide all forms so
that I could see the tables and queries at run time.

The combo boxes that I use to select the tables and queries to open are
populated in my code from the MSysObjects table, so there are a lot of them.
I did not want to have to create a form for each one for viewing/editing.

Bill
 
Top