docmd.Openform as datasheet

  • Thread starter Thread starter Chris C.
  • Start date Start date
C

Chris C.

I've got a form which is designed to default/allow only datasheet view.
When I open it via the db container, it opens as a datasheet. When I open
it via a docmd.openform in a button on another form of mine, it opens in
form view. What command do I need to use in my button to get it to open as
a datasheet?
 
I've got a form which is designed to default/allow only datasheet view.
When I open it via the db container, it opens as a datasheet. When I open
it via a docmd.openform in a button on another form of mine, it opens in
form view. What command do I need to use in my button to get it to open as
a datasheet?

When opening the form in code, you need to include the "View" argument
"acFormDS" that tells the form to open in datasheet view:

DoCmd.OpenForm "MyForm", acFormDS
 
Back
Top