Change form's view

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

Guest

Hi!
I've figured most of it out. All I need now is how to switch from a
datasheet view to a forms view and back using coded "click" events on
specific fields. Any suggestions?
 
Howard said:
Hi!
I've figured most of it out. All I need now is how to switch from a
datasheet view to a forms view and back using coded "click" events on
specific fields. Any suggestions?

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
 
Hi, Howard.

To switch to datasheet view, try:

RunCommand acCmdDatasheetView


To switch to form view, try:

RunCommand acCmdFormView

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Back
Top