1

Update: Manually losing the form and re-opening it also causes editing to be allowed, please see Step 4 below and "Additional Notes" section below. Thanks!

An MS-Access 2007 database that I have simplified a great deal during troubleshooting still has the same problem:

  1. Restart Access and open the database
  2. The autoexec calls a vba function that initializes some TempVars, then opens a form with: `DoCmd.OpenForm FormName:="MainEditor"
  3. All Bound and Un-Bound Text Boxes and Combo Boxes display their data correctly, but NONE of them can be edited. Keystrokes are ignored, pull-downs on Combo Boxes display lists of choices correctly but no choice can be selected.
  4. Change the form's view to Design View, then immediately change it back to Form View. Alternatively, manually close the Form and then re-open it.
  5. All the controls continue to display their data correctly, but now ALL of them can be edited normally.

After changing to Design View and back to Form View, the Form is editable normally until Access is shut down and restarted.

Additional Notes: I tried adding a DoCmd.Close and a DoCmd.FormOpen immediately after the original DoCmd.FormOpen in the startup function called by the Autoexec macro, but the Form remained unable to accept edits. Manually closing the form, and then manually re-opening it, seems to work every time. Is there any chance that Access needs a delay to process before opening the form, and manually doing the close/open cycle provides that time window?

Here's some background:

  • The Table has a primary index, 4 other indexes, and one-to-many relations to 7 other tables.
  • The Form's Record Source is the Table, and Allow Edits = Yes.
  • All the controls on the Form are set: Enabled = Yes, and Locked = No.
  • There are no sub-forms, only the one Form.

This isn't much to go on. If you ask for further specifics I'd be glad to provide them.

Thank you. Dave

Dave 2.71828
  • 115
  • 10
  • Does decompile eliminate the problem? [How does one decompile and recompile a database application?](http://stackoverflow.com/questions/3266542/how-does-one-decompile-and-recompile-a-database-application) – HansUp Feb 13 '16 at 06:53
  • Have you tried leaving off the DataMode setting and going with the default. I don't use it on my form opening. – akc42 Feb 13 '16 at 07:04
  • @HansUp Thanks for the good advice and the URL. I followed the decompile / compile procedure, but sadly it seems to have had no effect in terms of my problem. Thank you though, I did not know about decompiling. – Dave 2.71828 Feb 13 '16 at 08:18
  • @akc42 I've tried leaving out DataMode again just to make sure. I only added the explicit argument to allow editing in frustration to try and insist that the form open and allow edits. You are correct that "acFormEdit" is the default, and I should not need to include it in the actual arguments list. Thank you for the good suggestion! – Dave 2.71828 Feb 13 '16 at 08:21
  • Just a long shot, but based on a similar Excel bug: try minimizing and the maximizing the Access window after start. Or try switching to another form or any element inside the database, then going back to your form. – vacip Feb 13 '16 at 10:34
  • @vacip, Thank you for your suggestions! Although the specific actions you suggested weren't successful, based on your ideas I tried manually closing the Form and immediately manually opening the Form. This was successful, but unfortunately simply programming a DoCmd.Close followed by a 2nd DoCmd.OpenForm was not successful. I have updated my original question with these results. Thank you very much for the excellent ideas! – Dave 2.71828 Feb 13 '16 at 20:57
  • Instead of using an autoexec macro, specify a startup form. – Tom Robinson Feb 14 '16 at 02:42

1 Answers1

1

Instead of using an Autoexec macro, specify a startup form.

Tom Robinson
  • 1,850
  • 1
  • 15
  • 14
  • Nailed it. Isolating the form from the startup code started me down the path of checking everything that ran at startup, whether connected with this form or starting the system. Tedious because much of the code is needed to get the system running...otherwise it wouldn't be there. Anyway, many stubs later I found a typo in the name of a TempVar and that was the beginning of a sequence that turned off (among other things) the editing functionality. In other words, it's my fault. :-) **Thank you everyone for all the help;** I was really stuck. Dave – Dave 2.71828 Feb 15 '16 at 01:06