Results 1 to 8 of 8
  1. #1
    bbrazeau is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    101

    Suppress warning save changes to layout of table

    I have a form that when I open it I set some fields to Enabled=false.


    When I close the form I get a warning about saving changes to the layout of the table. I have commented out the Enabled= false lines and it gets rid of the warning. Is this a case where I should use docmd.SetwarningsFalse? Or is there another way to suppress this message.
    I've had this happen when I've hidden a column in a subform too, but if you say yes to the update layout message you don't get the warning any more. Seems it makes the columns hidden in the table the subform is based on.
    Thank You

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    How are you closing the form - command button Click? I normally disable the X close button on forms and control closing form with button. Try code in button: docmd.Close acForm, , acSaveNo
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bbrazeau is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    101

    Suppress warning save changes to layout of table

    Hi June7 I tried making a close button with the syntax you had in your post and I get "action requires object name argument". If I put the form name in it closes the form but still asks to save table layout. Also, I have a (right click) shortcut menu item that closes forms,but theres no provisions in the method I'm using macro "RunCommand Close" for specifying acForm or acSaveNo. I beleive I can rewrite the macro to close the forms by "RunCode" then have vba code do the closing, but if I have to put the name of the form its closing it won't be universal for other forms. I messed around a little more with commenting out the enabled=false lines and found that the warning is actually asking to save the layout of the underlying table of the subform I had set to enabled=false. Meaning I can uncomment all the enable=false lines for the main form and it closes without a warning. However,I don't want the user to be able to edit the subforms records only be able to add records by using a button on the main form and only then if the main forms record meets certain criteria ie. It hasn't been quoted yet. This is already implemented, so I don't want to mess too much with it. Is SetwarningsFalse what I should use? Or is there a better way? Oh yeah, the subform is not a form per say its a direct link to a table. Meaning its source object is a table not a form made from a table. Whew!! that was a mouth full.

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Normally you use

    DoCmd.Close acForm, Me.Name, acSaveNo

    but you may be able to use with your right-click

    DoCmd.Close acForm, ActiveForm.Name, acSaveNo

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I have never used a table as the SourceObject for a subform container. You might have better luck controlling this if you make it a form. Do you want to display existing records?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    bbrazeau is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    101

    Suppress warning save changes to layout of table

    Hi June7 and Bob,
    Bob I tried closing the form as you suggested and still got warnings. I will experiment more with this just for my knowledge. And I'll try the right click menu suggestion too.

    June7 I did not make the subform as a table reference "Access" did it when I made the form automatically based on the relationships and lookup field I had designed in the main forms underlying table design. I made a form from the subforms underlying table, deleted the existing subform and replaced it with the new subform and the warning message went away. I had some references in vba code for the main form to the old subform that I had to re-establish, and I had to rehide the fields I didn't want to see, but it seems to work. Thank you. I'm learning that there are many little idiosycrisecies that access has that either are'nt documented or are hard to find. Why did you ask "Do you want to display existing records?" I'm still perplexed as to why the original subform would stop giving the warning when I commented out the "me.child12.enabled=false" line??

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I have never used a table or query as the SourceObject for a subform container control. Guess now I know why I won't try.

    You said you don't want the user to be able to edit the subform records only be able to add records. If users don't need to view existing records the subform DataEntry property could be Yes and form will only allow new records. I did test of AllowAdditions Yes and AllowEdits No and that acted a little weird. You might try it and see what you think.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    bbrazeau is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    101

    Suppress warning save changes to layout of table

    Hi June7, I would like the user to see the existing subform records, so they know what parts will be included in the tooling quote. They can add other parts if the tool has not been quoted yet, but they can't edit the existing parts because this would invalidate the quote. So I have it so one person defines the parts to quote then someone else quotes what has been spec'd, then the subforms records are locked. ie.. if someone presses the button to add another part, code informs them the tool has been quoted and exits the function. Its all an attempt to aviod the "Blame Game"

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

Similar Threads

  1. Update table with different layout
    By Deutz in forum Queries
    Replies: 2
    Last Post: 10-03-2011, 10:51 PM
  2. Save changes to layout prompt
    By HunterEngineeringCoop in forum Access
    Replies: 2
    Last Post: 07-07-2011, 08:35 AM
  3. Make Table Warning Message
    By cassidym in forum Queries
    Replies: 1
    Last Post: 03-16-2011, 10:12 AM
  4. Replies: 9
    Last Post: 01-20-2011, 02:22 PM
  5. Table Layout Question
    By WonkeyDonkey in forum Database Design
    Replies: 6
    Last Post: 11-22-2005, 08:16 AM

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