Opening a form in Datasheet view

  • Thread starter Thread starter Chip
  • Start date Start date
C

Chip

Hi,

I am having a problem with a form that I want to open in datasheet view with
a button. I have datasheet view as the only available view and default view
set to datasheet view but when i open it with a button from another form it
opens in 'form view'. I must be missing something as i can open it by
double clicking it it opens as i need it in datasheet view, but when i use
the 'Open Form' button to this form that is on another form it opens in form
view.

Any Ideas???

THANKS IN ADVANCE!!!!!
 
in message:
Hi,

I am having a problem with a form that I want to open in datasheet view with
a button. I have datasheet view as the only available view and default view
set to datasheet view but when I open it with a button from another form it
opens in 'form view'. I must be missing something as I can open it by
double clicking it it opens as I need it in datasheet view, but when I use
the 'Open Form' button to this form that is on another form it opens in form
view.

If I may quote the Help file on the OpenForm Method:
Syntax:

DoCmd.OpenForm formname[, view][, filtername][, wherecondition][, datamode][, windowmode][,
openargs]

(Specifically the View area is where we need to look)

One of the following intrinsic constants:
View:
acDesign
acFormDS
acNormal (default)
acPreview
acNormal opens the form in Form view.
***If you leave this argument blank, the default constant (acNormal) is assumed.***

So even though you have Datasheet on the form's Properties list, it is being
overridden by not specifying the View argument in your OpenForm code.

You need to have something like this:

DoCmd.OpenForm "NameOfMyForm", acFormDS
 
Back
Top