Detecting Datamode

  • Thread starter Thread starter Simon Harris
  • Start date Start date
S

Simon Harris

Hi All,

I wish to conditionally display a button on a form, depending on the
datamode the form is currently in.

i.e. If the form is openeded as follows:
DoCmd.OpenForm stDocName, datamode:=acFormAdd

Then I do not want to display my button, other wise it should be displayed.

I guess all I really need is the method for accessing the datamode
property???

Thanks alot!

Simon.

--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
 
To display the button only if the form is not opened in Data Entry mode,
check that property in the Open event of the form:

Private Sub Form_Open(Cancel As Integer)
Me.[MyButton].Visible = Not Me.DataEntry
End Sub
 
Thanks for your post Allen - Exactly what I needed.

Regards,
Simon.

Allen Browne said:
To display the button only if the form is not opened in Data Entry mode,
check that property in the Open event of the form:

Private Sub Form_Open(Cancel As Integer)
Me.[MyButton].Visible = Not Me.DataEntry
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Simon Harris said:
I wish to conditionally display a button on a form, depending on the
datamode the form is currently in.

i.e. If the form is openeded as follows:
DoCmd.OpenForm stDocName, datamode:=acFormAdd

Then I do not want to display my button, other wise it should be displayed.

I guess all I really need is the method for accessing the datamode
property???
 
Back
Top