Open Table with Button on form

Hello

I would like to place a button that directly opens a particular table after
clicking it.
I am rather new to Access and cannot find the option in the Wizard.. 

Can someone help me?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1

0
hubertholz
3/12/2010 9:25:50 PM
access.formscoding 7493 articles. 0 followers. Follow

6 Replies
37080 Views

Similar Articles

[PageSpeed] 38

On Fri, 12 Mar 2010 21:25:50 GMT, hubertholz via AccessMonster.com
wrote:

> Hello
> 
> I would like to place a button that directly opens a particular table after
> clicking it.
> I am rather new to Access and cannot find the option in the Wizard.. 
> 
> Can someone help me?

So do you know how to write code?
Add a command button to the form (without using the Wizard).
Display the button's property sheet.
Select the Event tab.
On the Click event line enter 
[Event Procedure]
Then click on the little button with the 3 dots that appears on that
line.
The code window will open with the cursor flashing between two already
existing lines of code.
Between those 2 lines write:

DoCmd.OpenTable "TableName"

Change "TableName" to whatever the actual table name is.

Exit and save the changes.

Note... the fact that you can open the table does not mean you should.
Access Tables are for storing of data, not for viewing or
manipulation.
Allowing users to work directly in a Table is like playing with
matches in a hay loft.

You would be better off opening a form bound to the table in Datasheet
View.
Code the button's click event:

DoCmd.OpenForm "FormName", acFormDS

-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
11
fredg
3/12/2010 11:32:12 PM
The code would look like:

Private Sub cmdWhatever_Click()
    DoCmd.OpenTable "MyTable"
End Sub

where cmdWhatever is the name of the button and MyTable is the name of the 
table.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"hubertholz via AccessMonster.com" <u58479@uwe> wrote in message 
news:a4ea4cbd33e41@uwe...
> Hello
>
> I would like to place a button that directly opens a particular table 
> after
> clicking it.
> I am rather new to Access and cannot find the option in the Wizard..
>
> Can someone help me?
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1
> 


0
Arvin
3/12/2010 11:36:25 PM
I'm more concerned about the statement "cannot find the option in the Wizard"

After placing the button on the form, and the Wizard pops up, do you not have
the option, in the left hand column of ***Form Operations***

If so simply click on this then in the right hand column click on

Open Form

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1

0
Linq
3/13/2010 5:17:12 PM
Hi guys,

Thank you very much for your answers!

You are right, It would be rather stupid to let the user make changes in the
tables. However, I would like to provide him an overview of what is in the
table. Until now, whenever I construct a new form and want to present the
data there, I would have to, you know, flip one side after the other to get
to my desired input. But, I would like to see them all on one list. 
I think instead of opening the table, Id prefer this solution..?

hubert

Linq Adams wrote:
>I'm more concerned about the statement "cannot find the option in the Wizard"
>
>After placing the button on the form, and the Wizard pops up, do you not have
>the option, in the left hand column of ***Form Operations***
>
>If so simply click on this then in the right hand column click on
>
>Open Form
>

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1

0
hubertholz
3/14/2010 11:14:31 AM
"hubertholz via AccessMonster.com" <u58479@uwe> wrote in
news:a4fe1b66a018e@uwe: 

> Hi guys,
> 
> Thank you very much for your answers!
> 
> You are right, It would be rather stupid to let the user make
> changes in the tables. However, I would like to provide him an
> overview of what is in the table. Until now, whenever I construct
> a new form and want to present the data there, I would have to,
> you know, flip one side after the other to get to my desired
> input. But, I would like to see them all on one list. I think
> instead of opening the table, Id prefer this solution..? 
> 
> hubert

You can make a form appear just like a table datasheet with one click 
of the mouse. While in form properties, set the default view to 
datasheet. This form should not allow editing the fields.



> 
> Linq Adams wrote:
>>I'm more concerned about the statement "cannot find the option in
>>the Wizard" 
>>
>>After placing the button on the form, and the Wizard pops up, do
>>you not have the option, in the left hand column of ***Form
>>Operations*** 
>>
>>If so simply click on this then in the right hand column click on
>>
>>Open Form
>>
> 



-- 
Bob Quintal

PA is y I've altered my email address.
0
Bob
3/14/2010 12:38:06 PM
Using a datasheet has advantages even if you allow editing. You can protect 
(lock, disable) some fields. You can not allow deletions. You can create an 
audit that keeps track of edits. You cannot do any of that from a table.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"hubertholz via AccessMonster.com" <u58479@uwe> wrote in message 
news:a4fe1b66a018e@uwe...
> Hi guys,
>
> Thank you very much for your answers!
>
> You are right, It would be rather stupid to let the user make changes in 
> the
> tables. However, I would like to provide him an overview of what is in the
> table. Until now, whenever I construct a new form and want to present the
> data there, I would have to, you know, flip one side after the other to 
> get
> to my desired input. But, I would like to see them all on one list.
> I think instead of opening the table, Id prefer this solution..?
>
> hubert
>
> Linq Adams wrote:
>>I'm more concerned about the statement "cannot find the option in the 
>>Wizard"
>>
>>After placing the button on the form, and the Wizard pops up, do you not 
>>have
>>the option, in the left hand column of ***Form Operations***
>>
>>If so simply click on this then in the right hand column click on
>>
>>Open Form
>>
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1
> 


0
Arvin
3/15/2010 10:09:30 PM
Reply:

Similar Artilces: