Force form to open in DataSheet view

G

Guest

Using Office 2003 and Windows XP;

FormPopUP has its POPUP property set to Yes.
All views in FormPopUP's properties are set to no, except DataSheet.
FormPopUP's default view is set to DataSheet.
If FormPopUP is opened directly, it opens in DataSheet view as desired.

FormPopUP is called when the user double clicks a row on a subform.
When this happens, FormPopUP opens in Form view!

I tried putting:

If Not Screen.ActiveForm.CurrentView = 2 Then RunCommand acCmdDatasheetView

In the OnOpen event and in the On Load event, but I get an error: Can't
change the view now.

How can I force this form to open in DataSheet view every time?

If I didn't cover what you need to know, please post back...

Thanks in advance for your help.
 
F

fredg

Using Office 2003 and Windows XP;

FormPopUP has its POPUP property set to Yes.
All views in FormPopUP's properties are set to no, except DataSheet.
FormPopUP's default view is set to DataSheet.
If FormPopUP is opened directly, it opens in DataSheet view as desired.

FormPopUP is called when the user double clicks a row on a subform.
When this happens, FormPopUP opens in Form view!

I tried putting:

If Not Screen.ActiveForm.CurrentView = 2 Then RunCommand acCmdDatasheetView

In the OnOpen event and in the On Load event, but I get an error: Can't
change the view now.

How can I force this form to open in DataSheet view every time?

If I didn't cover what you need to know, please post back...

Thanks in advance for your help.

Regardless of your form's default view setting, to open a form in
Datasheet View from a code event, you must explicitly use:

DoCmd.OpenForm "FormName", acFormDS
 

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