Hello All,
I would like to create a button on a form that will open any table, not just
a specific table. Is there a way to do this?
Thanks
Well, yes you can, but why would you want to?
Add an unbound combo box to the form.
Set it's Bound Column property to 1.
Set it's RowSource property to:
SELECT MSysObjects.Name FROM MSysObjects WHERE
(((Left([Name],4))<>"MSys") AND ((MSysObjects.Type)=1)) ORDER BY
MSysObjects.Name;
Add a Command button.
Set it's Click event to:
DoCmd.OpenTable ComboName
Select the table from the combo box and click the command button.
Now that I've told you how, I'd like to caution you against allowing
users to view any table. Tables are for storing data, not for viewing.
Allowing a user to view and possibly edit directly in a table is
looking for grief.