Ddisplay form in datasheet view using VB

G

Guest

This is probably very simple, but can anyone tell me how to open a form in
data sheet view using VB. I've set the default view for the form to be
datasheet and when I double click on the form, it opens in datasheet view.
But when I use the code below to open the form it will not open in datasheet
view:

DoCmd.OpenForm stFormName

I've tried all kinds of options with OpenForm, but fails to open the form in
Datasheet View. Any help will be greatly appreciated.
 
G

Guest

I've found the answer to my own question. The code is below if anyone is
interested:
DoCmd.OpenForm stDocName, acFormDS
acFormDS is the key.
 

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