recogising how form is openned

  • Thread starter Thread starter Andre C
  • Start date Start date
A

Andre C

is there a VBA way of telling if a form is opened in add or edit
mode. I want to make a particular control invisible if the form is
opened in add mode.
 
is there a VBA way of telling if a form is opened in add or edit
mode. I want to make a particular control invisible if the form is
opened in add mode.

If Me.AllowEdits = true Then

If Me.AllowAdditions = True Then

If Me.DataEntry = True then
 
That will tell you whether they are allowed, but it will not tell you the
datamode of the form.

If there is a property that returns that condition, I am not aware of it.
One solution would be to use the OpenArgs argument of the OpenForm method to
tell the form what mode it is being opened in. Then in the Load event of the
form, check the value of OpenArgs to determine whether to show or hide the
control.

Not elegant, but I can't find another way.
 

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

Back
Top