Form in View Mode Only will not open in MS Access 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Osokop
    New Member
    • Apr 2010
    • 1

    #1

    Form in View Mode Only will not open in MS Access 2003

    I have run into an odd problem I have never had in 15 years of messing around with MS Access.

    I have a form which has buttons on a Option Group. When the user selects an option button, a tiny module runs that just closes the current form and opens the one they want to see. In this case, I want this form to be VIEW only and not allow edits. I am using the command of:
    Code:
        DoCmd.Close acForm, "ActivityView", acSaveYes
        DoCmd.OpenForm "Arrests", acNormal, , , acFormReadOnly, acWindowNormal
    This works on every other form in my database, that records police activity for selected denizens of Glendale.

    For some reason, I can save the form, then open and run it and it runs properly and opens the designated form in VIEW only mode. However, after that first time it no longer will open the form or work again. If I edit it, save it, I can then get it to work once, but no more.

    I have compacted, repaired, and done everything else I can think of and have even recreated the form within the database, to no avail.

    Perplexed and giddy in Glendale!

    HELP?
    Last edited by NeoPa; Apr 9 '10, 10:50 AM. Reason: Please use the [CODE] tags provided.
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Any code behind the form your opening?

    I can't spot anything wrong with your approach, and it certainly sounds odd, the "working once" thing.

    If you attach the db here, I can take a look.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      I think this probably lies in the saving of forms. I'm not clear from your explanation which of the forms you're referring to when you say you saved "it", but as I suspect there's no situation where the design of the form should be updated during the execution of the code, this is probably immaterial.

      If it really is your intention to save the design of any of your forms then perhaps you could explain your intentions more clearly. If not (as I suspect) then remove this from the code and see how things work in those circumstances.

      PS. To save the data, if that's what you're intending, you can set the Dirty property of the form to False. Strangely, this doesn't roll back any changes, but saves them instead.

      Comment

      Working...