Results 1 to 3 of 3
  1. #1
    excellenthelp is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    93

    AllowDeletion Property on OnOpen event

    Hi Accessers,



    I am attempting to make the code function well to no avail. The form consists of a subform (datasheet). The Allow properties is for the subform. What am I writing incorrectly?!

    Code:
    Private Sub Form_Open(Cancel As Integer)On Error GoTo Err_Form_Open
        
        If User.AccessID = 1 Then
            Me.Form.AllowAdditions = True
            Me.Form.AllowDeletions = True
            Me.Form.AllowEdits = True
        ElseIf User.AccessID = 2 Then
            Me.Form.AllowAdditions = True
            Me.Form.AllowDeletions = False
            Me.Form.AllowEdits = False
        Else
            Me.Form.AllowAdditions = False
            Me.Form.AllowDeletions = False
            Me.Form.AllowEdits = False
        End If
            
    Exit_Form_Open:
        Exit Sub
    
    
    Err_Form_Open:
        MsgBox Err.Description
        Me.Visible = True
        Resume Exit_Form_Open
    End Sub
    SPECS:
    Access 2010
    64-bit system

    Thanks for the help!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    Did you use the builder to set these controls?
    I think it may be me.child.form.allowedits

    (sub forms in a main form usually are named CHILDxxx)

  3. #3
    excellenthelp is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    93
    Not sure how to use CHILD control.

    How could I build a such code?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 05-08-2014, 10:34 AM
  2. Replies: 3
    Last Post: 01-18-2014, 02:20 PM
  3. How do you use an event property for a form?
    By Access_Novice in forum Programming
    Replies: 6
    Last Post: 12-31-2013, 02:46 AM
  4. Replies: 5
    Last Post: 07-05-2013, 06:08 AM
  5. Replies: 2
    Last Post: 01-22-2013, 10:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums