Change View to Datasheet

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

Guest

I am looking to set-up a command button on a form to toggle the form between
Datasheet and Form View. Thank You for any assistance
 
To quote the all-powerful MVP Dirk Goldgar:

' Begin quote

Switch active form to datasheet view:

RunCommand acCmdDatasheetView

Switch active form to form view:

RunCommand acCmdFormView

To toggle the view:

Select Case Screen.ActiveForm.CurrentView
Case 1
' Currently in form view
RunCommand acCmdDatasheetView
Case 2
' Currently in datasheet view
RunCommand acCmdFormView
Case Else
' Must be design view (0) or some as yet undefined view
' Do nothing.
End Select

' End Quote
 
Justin said:
I am looking to set-up a command button on a form to toggle the form
between Datasheet and Form View. Thank You for any assistance

See my reply to Howard, in this newsgroup, subject "Re: Change form's
view", dated Monday, November 15, 2004 7:53 PM (EST).
 

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