C coypu Registered User. Local time Today, 11:01 Joined Mar 12, 2019 Messages 33 Mar 15, 2019 #1 Hi, how does one detect immediately a form is changed from normal to datasheet view?
isladogs MVP / VIP Local time Today, 11:01 Joined Jan 14, 2017 Messages 18,853 Mar 15, 2019 #2 You could add code like this: Code: Private Sub Form_Current() If Me.CurrentView = 2 Then MsgBox "Datasheet view" End Sub The full list of values are Code: Setting Form displayed in: 0 Design view 1 Form view 2 Datasheet view 7 Layout view Or you can prevent datasheet view completely in the form property sheet
You could add code like this: Code: Private Sub Form_Current() If Me.CurrentView = 2 Then MsgBox "Datasheet view" End Sub The full list of values are Code: Setting Form displayed in: 0 Design view 1 Form view 2 Datasheet view 7 Layout view Or you can prevent datasheet view completely in the form property sheet
C coypu Registered User. Local time Today, 11:01 Joined Mar 12, 2019 Messages 33 Mar 15, 2019 #3 Excellent, thanks Colin I forgot about testing during the form's On Current event.