Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    38

    Unanswered: Opening A form Read Only

    Byusing a command button, I would like to open a form read only. I tried following on the on click property of the command button but it did not work.

    DoCmd.OpenForm "frmPCMSch"
    Forms!frmPCMSch.AllowAdditions = False
    Me.AllowEdits = False
    Me.AllowDeletions = False

    Could someone kindly help?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Look in VBA help at the options available for OpenForm.
    Paul

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    DoCmd.OpenForm "frmPCMSch"
    Forms!frmPCMSch.AllowAdditions = False
    Forms!frmPCMSch.AllowEdits = False
    Forms!frmPCMSch.AllowDeletions = False

    or

    DoCmd.OpenForm "frmPCMSch"

    and then in the onLoad event of frmPCMSch put....

    me.AllowAdditions = False
    me.AllowEdits = False
    me.AllowDeletions = False
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    May 2006
    Posts
    38
    Many thanks for your help.

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    pbaldy is referring to this:

    DoCmd.OpenForm FormName, , , , acFormReadOnly

    But that's only if you want to do it the easy way
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Why use one command when four will do?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I could expand it to like 50 lines of code if needed
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Even better!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •