hi,
I am using MS ACCESS 2003 and using VB code within Access to toggle the screen from datasheet view to form view. code wht i am entering is:

Code:
Public Sub Toggle()
   
    'Toggles the view as the form between datasheet view and form view
    'It is going to check the form view
    If Me.CurrentView = 1 Then
        'form View is Single Form Change to Datasheet
        DoCmd.RunCommand (acCmdDatasheetView)
    Else
        'form View is Datasheet Change to Single Form
        DoCmd.RunCommand (acCmdFormView)
    End If
End Sub
when entering code i am getting the error:
"the expression you entered contains invalid syntax" , If anyone could advise me then will be appreciated.

Plz accept my ignorance if i miss any thing as i am new to this forums.