Hi, how does one detect immediately a form is changed from normal to datasheet view?
C coypu Registered User. Local time Today, 17:06 Joined Mar 12, 2019 Messages 26 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, 17:06 Joined Jan 14, 2017 Messages 18,246 Mar 15, 2019 #2 You could add code like this: Code:Copy to clipboard Private Sub Form_Current() If Me.CurrentView = 2 Then MsgBox "Datasheet view" End Sub The full list of values are Code:Copy to clipboard 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:Copy to clipboard Private Sub Form_Current() If Me.CurrentView = 2 Then MsgBox "Datasheet view" End Sub The full list of values are Code:Copy to clipboard 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, 17:06 Joined Mar 12, 2019 Messages 26 Mar 15, 2019 #3 Excellent, thanks Colin I forgot about testing during the form's On Current event.