Me.AllowEdits = False

D

DCPan

Hi,

I have a subform in a form.

On opening the form, I have a VB script that turns allowedits on and off
based on parameters. The script kicks off on the "on open" event.

The weird thing is, despite having Me.AllowEdits = False for both the form
and the subform, I find that if I click on the subform, then click back on
the main form, allowedits somehow became "true" and I can edit stuff.

Has other people ran into this?

Do I need to change the allowedit to fire on a different event?

Thanks!
 
K

Klatuu

Try using the Load event instead of the Open event. The Open event can be
too soon so that all the objects are not yet enstansiated. Also note that
when opening a form with a subform, the subform loads first.

I would suggest you handle the form and subform separately in the Load
events. It may be a timing issue.

If that doesn't work, run your code in debug mode so you can tell what is
happening when.
 
D

DCPan

In the end, I got around it by disabling the subform on the load of the main
form.

For some strange reason, the on load didn't work.
 
D

DCPan

Oh, thanks...I don't think your suggestion registered my brain properly until
the 2nd time around :)
 

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