I am trying to add VBA code to a particular form so that the code detects when form's mode is changed from Form View to Design View by a user and then does something special when this happens. Using Access 2007.

The Me.CurrentView property is supposed to return a "0" if a form is in Design View and a "1" if it is in Form View. I tried the below code but the Me.CurrentView always returns a "1" when the form is changed from Form View to Design View. I tried the code with various form events (as listed under the Events tab on the Forms's properties page) but the Me.CurrentView always returns a "1". I suspect this is because all of the events under the Events tab occur prior to the form changing from Form View to Design view.

Any thoughts on an alternate way to do this? I know I can disable Design View altogether via various Access Options (e.g disable full menus, disable shortcut menus, etc.) but this is not what I want to do


[VBA]Private Sub Form_Unload(Cancel As Integer)
Dim intView As Integer
intView = Me.CurrentView
If intView = 0 Then
'DO SOMETHING SPECIAL
Else
'DO NOTHING
End If
End Sub[/VBA]