On opening the Database would like to have it display a table

M

MSA

Hi,

I would appreciate if someone could guide how I can make a table be opened
automatically whenever the Db is opened.

Thanks in advance for your input.

Regards,
MSA
 
W

Wayne-I-M

Hi

It can be done - but shouldn't. You should work on a form or query not the
table.

Use the Tools - Startup - Display Page/Form wizard to open the the correct
form when you open the DB.

Good luck
 
D

Daniel Pineault

Wayne is completely right! Dbs such as access users should not ever being
editing tables directly (one of the golden rules).

However, not knowing the whys of your question, it can be done as follows.

Create a module and create a function in it.
Add error handling and a command to open your table (DoCmd.OpenTable ....)
Then create a macro called Autoexec and and in the action use RunCode and
set the Function Name to whatever function your setup to open your table.
 
M

MSA

Hi Wayne,

Thanks for the advice. So you are saying that I should show the table thru a
form and have have it opened via Tools - Startup - Display Page/Form wizard,
correct. So there is no way to open the table itself directly.

Regards,
Ali
 
W

Wayne-I-M

Thanks for the advice. So you are saying that I should show the table thru a
form and have have it opened via Tools -

No - don't open the table at all unless you need to work on it (that's
application development, not day to day work).

Create a query based on the table then create form based on the query.
The reason for the 2 stage step is that it gives you the chance to use the
query's functions and include them in the final form.
 
D

Dale Fye

Agree with Wayne and Daniel that database "users" should never have direct
access to a table. You limit the damage they can do by providing them with
forms, which have error checking and other functionality. However, if you
want it to open the table for you (the developer) every time the database is
opened, then you could also create a Macro.

Use the OpenTable method, provide the table name in the place provided at
the bottom of the page.

Then save the macro as Autoexec.

HTH
Dale
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
Top