datasheet view

G

Guest

I created a form which opens in the datasheet view. When I open that form,
it looks just like a table. Perfects. When I place a comand button on a
form and call the first form, it opens in a form view. Why does this happen?
How can I get it to behave the way I want it?

Thanks.
 
A

Allen Browne

If you open the form from code, the default is Form view so you must specify
a different view e.g.:
DoCmd.OpenForm "Form1", acFormDS
 
D

Dirk Goldgar

rml said:
I created a form which opens in the datasheet view. When I open that
form, it looks just like a table. Perfects. When I place a comand
button on a form and call the first form, it opens in a form view.
Why does this happen? How can I get it to behave the way I want it?

The code behind the button specifies the view in which the form opens.
Where you may now have

DoCmd.OpenForm stDocName, , , stLinkCriteria

(if the button was built by the command button wizard), you need to
change it to

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

The default for OpenForm is acNormal, which opens the form in Form view,
not Datasheet view.
 
J

John Vinson

I created a form which opens in the datasheet view. When I open that form,
it looks just like a table. Perfects. When I place a comand button on a
form and call the first form, it opens in a form view. Why does this happen?
How can I get it to behave the way I want it?

Thanks.

Use the optional View parameter in the OpenForm method code in your
button code:

DoCmd.OpenForm "FormName", acViewDatasheet, ... <other parameters>

John W. Vinson[MVP]
 
J

John Vinson

Use the optional View parameter in the OpenForm method code in your
button code:

DoCmd.OpenForm "FormName", acViewDatasheet, ... <other parameters>

John W. Vinson[MVP]

oops... shouldn't have been working from memory... acFormDS of course,
as the other good folks correctly stated.

John W. Vinson[MVP]
 
P

Pieter Wijnen

Which offcourse will hide the CommandButton From view <g>.
The 3 alternatives are:
1) Create a Custom Toolbar to mimick the functionallity of the
CommandButton, elegant but it rather complex to explain to a newbie
2) Use the Datasheet form as a subform on a (unbound) Form & put the button
there, easier
3) Make it a continous Form, which is simple & "almost" like Datasheet view

Pieter
 
D

Dirk Goldgar

"Pieter Wijnen"
<it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.rep
lace.with.norway>
wrote in message news:[email protected]
Which offcourse will hide the CommandButton From view <g>.

I believe the command button is on a different form from the one that is
to be opened in DS view.
 

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