Data Sheet View

C

Cliff Waters

Hi
Please can anyone help me?
I would like to put a button on a form to bring up the Datasheet view of the
form is this possible.

Thanks in advance for any help

Cliff
 
L

Larry Linson

Although it is not easy to determine from Help in Access 2003, the
DefaultView property of the form, which indicates the view in which the form
will be opened, can be changed only in Design View.

To do what you want, you'd have to open the Form in Design View, execute
code to change Default View, and reopen in Form View. And, of course, under
these circumstances, it would remain in the last-selected view until you
changed the Default View again.

It seems to me it would be simpler to make a copy of the Form, set its
Default View to Datasheet, and use your Command Button to open that Form.

Larry Linson
Microsoft Access MVP
 
V

Van T. Dinh

In the Click Event of the CommandButton, use the code:

DoCmd.RunCommand acCmdDatasheetView
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top