Detecting Datamode

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!
 
A

Allen Browne

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
 
S

Simon Harris

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???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top