Results 1 to 10 of 10
  1. #1
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132

    Form allows additions even though opening in Edit mode

    I have a form (EventInviteF) with the following properties:



    Data:
    Allow Additions - No
    Allow Deletions - No
    Allow Edits - Yes

    EventInviteF is opened by a button (Command20) on another form (MainMenuF). Command20 has the following properties:

    Event:
    On Click [Embedded Macro]
    - Form Name (EventInviteF)
    - View (Form)
    - Data Mode (Edit)
    - Window Mode (Dialog)


    When I open the form by double-click, it doesn't allow additions (see pic).

    Click image for larger version. 

Name:	On Double Click.jpg 
Views:	3 
Size:	73.3 KB 
ID:	9502

    When I open with the form, it does (see pic).

    Click image for larger version. 

Name:	On Form Button Click.jpg 
Views:	3 
Size:	90.6 KB 
ID:	9501

    Sorry the pics are so small inline. Didn't know how to make them bigger!

    Thanks for any thoughts! Much appreciated!

    --ak

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You're setting the Data Mode property in your ON CLICK event of the previous form. If you don't intend anyone to be able to edit this form set data mode property of the form itself. What you are doing is setting the data mode when you open it from your form only, not as a 'permanent' block.

  3. #3
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132
    Hi, rpeare!

    They are supposed to be able to edit the form (they are supposed to check or uncheck the boxes). They are not supposed to add to the form -- on double-click, it's not allowing them to add, but on button-click, it is.

    Does that make sense?

    Do you have any further thoughts?

    Much appreciated!

    --ak

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Without knowing the code behind your form, I can't really give you direction. If you strictly want them to be able to click the boxes on the right and not be able to add any new items that's related to your FORM when you open it

    look at the properties of your form and set these two items

    ALLOW EDITS to NO
    ALLOW ADDITIONS to NO

    Whenever the form is opened they will not be allowed to edit or add items to your list

  5. #5
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132
    Thanks, rpeare.

    They do need to be able to EDIT, they are just not supposed to be able to ADD.

    When I access the form via double-click, it acts correctly (allows EDIT, prohibits ADD).
    When I access the form the way the users will -- via a the Command20 button, it allows them to ADD, which it is not supposed to do.

    Does that help?

    The problem seems to be something wrong with the buttom parameters.

    Thanks!

    --ak

    p.s. Incidently, I tried your suggestion. On double-cilck, it then prohibited both ADD and EDIT. However, access via the button still allowed both.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    no, I've said it twice now, it's the properties of your form, you are setting the edit property when you click your button but that doesn't make it a permanent effect.

    if you only want to allow edits and not additions look at the two properties I told you before, allow edits would obviously be set to yes, allow addtions to no.

    Again, I do not know how your form is coded but this is the easiest solution if you are using a BOUND form.

  7. #7
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132
    Thank you, repare!

    In my very first entry, you can see that in my form, I DO have my EIDTS set to YES and my ADDITIONS set to NO.
    It works perfectly when I double-click the form.
    When I open the form via my button (where I ask it to open the form in Edit mode), it also allows additions, and that is the problem.

    I am sorry to be so obtuse, but I can't figure out what I'm doing wrong, and I do appreicate your time and thoughts!

    --ak

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    When you open one Form from another Form, the Add/Delete/Edit Properties as set in that Form usually mean absolutely nothing! Opening a Form from another Form using the acFormEdit allows you to Edit and Add New Records, as you've found out!

    But note that I said usually! If you want these Properties to persist on a Form, when opening it from another Form, you have to use the DataMode acFormPropertySettings, instead. Never using Embedded Macros, I do not know if you have that option, but this code will do the job, replacing all names appropriately:

    Code:
    Private Sub OpenSecondFormButton_Click()
     DoCmd.OpenForm "SecondFormName", , , , acFormPropertySettings
    End Sub


    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132
    Thanks, Linq!

    I've tried the following, but it still lets me add:

    Private Sub Command20_Click()
    DoCmd.OpenForm "EventInviteF", , , , acFormEdit
    End Sub

    Where could I be going wrong?

    Thanks!

    --ak

  10. #10
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132
    Ah, Linq -- Thank you so much. I made the mistake of using acFormEdit -- I thought I was supposed to substitute "What I want" for "FormProperty" -- sort of like DoCmd.OpenForm "Name of your form" type thing. Once I entered what yuo said to enter, rather than what I thought you meant, it worked famously.

    Much, much appreciated!!!

    --ak

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

Similar Threads

  1. Change form to edit mode using VBA
    By Richie27 in forum Programming
    Replies: 1
    Last Post: 06-05-2012, 04:39 AM
  2. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  3. Replies: 2
    Last Post: 09-01-2011, 10:48 PM
  4. Opening Saved data in form in Edit mode
    By l3111 in forum Forms
    Replies: 7
    Last Post: 06-06-2011, 11:37 AM
  5. Opening Form in Data Entry Mode Problem
    By alsoto in forum Forms
    Replies: 1
    Last Post: 05-28-2009, 07:45 PM

Tags for this Thread

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