How to open form in datasheet view from the switchboard?

F

Fjordur

Hi,
I have a form that I want to open in Datasheet View.
Therefore it has both the Default View and the Views Allowed properties set
to Datasheet.
When I open the form from the database window it does open as a datasheet.
But when I open it from the switchboard it opens as continuous form. From
the continuous form view, if I switch to design view, the View menu shows
Datasheet view, Form view is dimmed.
What did I miss? or is it impossible to open a form in Datasheet view from
the Switchboard?
Thanks for the help
 
G

Guest

Fjordur,

I would say that it is to use the openform statement and change the view to
acFormDS instead of the default AcFormView.

docmd.openform "Form1", acFormDS

OpenForm(FormName, [View As AcFormView = acNormal], [FilterName],
[WhereCondition], [DataMode As AcFormOpenDataMode = acFormPropertySettings],
[WindowMode As AcWindowMode = acWindowNormal], [OpenArgs])

I don't have access on this machine but I would presume this would work. If
not I am sure other members will post back the correct line as I am about to
go into a meeting.

Alastair MacFarlane
 
G

Guest

Fjordur

Alastair code is correct:
DoCmd.OpenForm "yourformname", acFormDS

Explanation:
If you use the command button wizard to make your button, a code is
automatically
being generated for that command button. At default the form will be open in
form
view, so you will have to change the code to open the form in datasheet view.

To access the code go into the properties of the command button and click
events.
examine teh code and follows arguement alastair gave you.

OpenForm(FormName, [View As AcFormView = acNormal], [FilterName],
[WhereCondition], [DataMode As AcFormOpenDataMode = acFormPropertySettings],
[WindowMode As AcWindowMode = acWindowNormal], [OpenArgs])

Alastair MacFarlane said:
Fjordur,

I would say that it is to use the openform statement and change the view to
acFormDS instead of the default AcFormView.

docmd.openform "Form1", acFormDS

OpenForm(FormName, [View As AcFormView = acNormal], [FilterName],
[WhereCondition], [DataMode As AcFormOpenDataMode = acFormPropertySettings],
[WindowMode As AcWindowMode = acWindowNormal], [OpenArgs])

I don't have access on this machine but I would presume this would work. If
not I am sure other members will post back the correct line as I am about to
go into a meeting.

Alastair MacFarlane

Fjordur said:
Hi,
I have a form that I want to open in Datasheet View.
Therefore it has both the Default View and the Views Allowed properties set
to Datasheet.
When I open the form from the database window it does open as a datasheet.
But when I open it from the switchboard it opens as continuous form. From
the continuous form view, if I switch to design view, the View menu shows
Datasheet view, Form view is dimmed.
What did I miss? or is it impossible to open a form in Datasheet view from
the Switchboard?
Thanks for the help
 
R

Ron2006

The switchboard will open them in form view period unless you start
mucking around inside of the switchboard form.

Create a brand new empty form - disable some of the selector stuff on
the form tab otherwise you get multiple arrow sets at the bottom.
Place the form you want to open in datasheet view on it and have it
fill the form.

change the switchboard to open your new form.
 

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