how to open a tabel from Form (1 Viewer)

AccessWater

Registered User.
Local time
Today, 11:36
Joined
Jun 14, 2006
Messages
52
I used two combo boxes in a form to enter data into a table. I want to allow user to look at the table from the Form. Can I use a Command Button to do so? Thank you for your help.
 

bonekrusher

Registered User.
Local time
Today, 08:36
Joined
Nov 19, 2005
Messages
266
add a button with this VBA code:

docmd.opentable ("nameoftable")
 

AccessWater

Registered User.
Local time
Today, 11:36
Joined
Jun 14, 2006
Messages
52
Thank you very much, bonekrusher. It works perfectly.
 

Banana

split with a cherry atop.
Local time
Today, 08:36
Joined
Sep 1, 2005
Messages
6,318
But why?

You understand that if you let users access the tables, they may make changes that will not be validated, break referential integrity, etc. etc. among other things?

They should be looking at forms only. If you wanted a tabular view, you can have a form open in a datasheet instead which will look like table. I've never used a datasheet view so maybe soemone can clarify whether it will continue to follow the rules.
 

bonekrusher

Registered User.
Local time
Today, 08:36
Joined
Nov 19, 2005
Messages
266
Sometimes tables needed to be updated. For example if you have a combo box thats is linked to a table, the user may want to add or modify.
 

ansentry

Access amateur
Local time
Tomorrow, 01:36
Joined
Jun 1, 2003
Messages
995
bonekrusher,
Sometimes tables needed to be updated. For example if you have a combo box thats is linked to a table, the user may want to add or modify.

When you need to add to tables you should only allow users to do this via Forms.

With a combo box you can either add via a form or use the Not in List feature of the combo box.
 

Users who are viewing this thread

Top Bottom