Results 1 to 14 of 14
  1. #1
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question Access 2019: Why the “remove form” option is deemed for visual basic?

    Access 2019: Why the “remove form” option is deemed for visual basic?



    I couldn’t figure out why the “remove form” option is deemed for visual basic. Then how these forms can be deleted?

    Click image for larger version. 

Name:	Clip_252.jpg 
Views:	30 
Size:	224.9 KB 
ID:	43303

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    You don't delete forms from the Visual Basic Editor.
    To delete a from, right click on its name in the Navigation Pane, in your image, it's under All Access Objects on the left

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Never noticed that option in the Vbe. I did some quick googling but haven't found any explaination for it.
    What is that remove option for?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Those are not forms. Those are the Class modules of the forms.

    "If you set the HasModule property to No by using an object's property sheet or set it to False by using Visual Basic, Access deletes the object's class module and any code it may contain."

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    The command is also disabled for the class modules of reports.
    As accesstos rightly says deleting the class module instantly deletes all code in that.
    If that command were enabled it would be far too easy to delete all your code by mistake.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113
    Quote Originally Posted by accesstos View Post
    Those are not forms. Those are the Class modules of the forms.

    "If you set the HasModule property to No by using an object's property sheet or set it to False by using Visual Basic, Access deletes the object's class module and any code it may contain."
    Many thanks guys for the help.

    Where is the “object's property sheet”?

    Click image for larger version. 

Name:	Clip_260.jpg 
Views:	25 
Size:	178.1 KB 
ID:	43306

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Open the form/report in design view - the property sheet should appear on the right of the screen. If not, click Property Sheet in the form Design ribbon
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Where is the “object's property sheet”?
    Click image for larger version. 

Name:	FormProperties.JPG 
Views:	26 
Size:	48.8 KB 
ID:	43307

    Cheers,
    John

  9. #9
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Quote Originally Posted by isladogs View Post
    The command is also disabled for the class modules of reports.
    As accesstos rightly says deleting the class module instantly deletes all code in that.
    If that command were enabled it would be far too easy to delete all your code by mistake.
    I'm aware of the consequences but what I was wondering is what that command is for? When is it enabled and why?
    I couldn't find any explanation of it.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  10. #10
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    It is enabled for standard modules and custom class modules. In these cases, VBE gives you the opportunity to save the item before removing it. I'm not sure, but I think that, for Form class modules, object dependency issues are involved, and an object that is member of an other object, must be removed through the parent object.

  11. #11
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113
    Quote Originally Posted by accesstos View Post
    Click image for larger version. 

Name:	FormProperties.JPG 
Views:	26 
Size:	48.8 KB 
ID:	43307

    Cheers,
    John
    I couldn’t manage to do it. Still I can’t delete modules!


    Click image for larger version. 

Name:	Clip_277.jpg 
Views:	20 
Size:	137.9 KB 
ID:	43309


    Click image for larger version. 

Name:	Clip_278.jpg 
Views:	20 
Size:	201.7 KB 
ID:	43310

  12. #12
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    In property sheet, set the "Has module" to "No", confirm your choice in the relevant message and save the form.

  13. #13
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Quote Originally Posted by accesstos View Post
    It is enabled for standard modules and custom class modules. In these cases, VBE gives you the opportunity to save the item before removing it. I'm not sure, but I think that, for Form class modules, object dependency issues are involved, and an object that is member of an other object, must be removed through the parent object.
    Thanks. I suppose its termed "Remove" rather than "delete" as it does ask if you want to export it first. Never noticed it before (nor needed it)
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  14. #14
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113
    Thank you guys for the help
    best
    Jamal

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

Similar Threads

  1. Using Access Instead of Visual Basic
    By dinz in forum Programming
    Replies: 2
    Last Post: 12-19-2019, 10:33 AM
  2. Replies: 4
    Last Post: 07-08-2013, 03:46 PM
  3. Replies: 6
    Last Post: 07-06-2012, 07:13 PM
  4. Converting Access to Visual Basic
    By Juicejam in forum Access
    Replies: 3
    Last Post: 04-12-2012, 02:39 AM
  5. how to use visual basic in access
    By learning_graccess in forum Access
    Replies: 3
    Last Post: 12-05-2011, 03:23 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