1
votes

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

1
Have you tried leaving off the DataMode setting and going with the default. I don't use it on my form opening. - akc42
@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
@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
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

1 Answers

1
votes

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