datasheet view not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form whose default view is Datasheet and the Alllow Form View is set
to No. If I just open the form, it displays in datasheet view. But if I
create a button on another form to open it (using DoCmd.OpenForm formname) it
will only show in Form View. This is not the first time this has happened to
me and previously I worked around it by creating a form with a subform...but
I'd really like to know why this isn't working the way I think it should.
 
in message:
I have a form whose default view is Datasheet and the Alllow Form View is set
to No. If I just open the form, it displays in datasheet view. But if I
create a button on another form to open it (using DoCmd.OpenForm formname) it
will only show in Form View. This is not the first time this has happened to
me and previously I worked around it by creating a form with a subform...but
I'd really like to know why this isn't working the way I think it should.

Hi,

If you do not specify a View argument in the OpenForm method, then
acNormal is assumed (which is normal form view). You need to add
the acFormDS argument. Adjust your OpenForm code to something
like this:

DoCmd.OpenForm "Name Of Your Form Here", 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

Back
Top