Me.AllowEdits = False

  • Thread starter Thread starter DCPan
  • Start date Start date
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!
 
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.
 
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.
 
Oh, thanks...I don't think your suggestion registered my brain properly until
the 2nd time around :)
 
Back
Top