Tags: access, database, datasheet, form, hoi, macro, menubar, microsoft, mysql, oracle, somebody, sql, switch, view

Access from "Form View" to "Datasheet View"

On Database » Microsoft Access

1,256 words with 1 Comments; publish: Sun, 01 Jun 2008 15:52:00 GMT; (250203.13, « »)

Hoi,

Somebody can help me out.

I need a macro where I can switch from the database "Form View" to the

"Datasheet View".

I can do it with the menubar option, but I want to do it with a

button.

regards,

Johan

All Comments

Leave a comment...

  • 1 Comments
    • Hi johan,

      I'm using Access 2000, but guess there will be not much differences in the

      new versions:

      In the click_event of a button in a mask, try something like this:

      If (Me.CurrentView = 1) Then ' Mask

      DoCmd.RunCommand acCmdDatasheetView

      ElseIf (Me.CurrentView = 2) Then ' Datasheet

      DoCmd.RunCommand acCmdFormView

      End If

      In effect, the second condition is not fired, because in datasheet view the

      button is no more present, but you can link this code to a different source

      Hope this helps.

      Bye.

      "johan" <jmslab.ms-access.questionfor.info.xs4all.nl> ha scritto nel messaggio

      news:1186744370.022347.126370.ms-access.questionfor.info.e9g2000prf.googlegro ups.com...

      > Hoi,

      > Somebody can help me out.

      > I need a macro where I can switch from the database "Form View" to the

      > "Datasheet View".

      > I can do it with the menubar option, but I want to do it with a

      > button.

      > regards,

      > Johan

      >

      #1; Sun, 01 Jun 2008 15:54:00 GMT