Results 1 to 3 of 3
  1. #1
    ScubaBart is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jul 2024
    Posts
    117

    Ref the main form when inside the subform - hopefully simple

    I am using a Public Variable (PrevForm)to carry the value of any calling form so that when the new form closes, it returns to the appropriate form. (There are multiple paths to get to some forms and I'm not a fan of leaving bunches of forms open)

    When I open the new form with a button located on the main form, it's simple, the PrevForm = Me.Name



    However, when I use a button that is located in the subform, that syntax records the name of the subform, not the main form.

    What would the proper syntax be to reference the main from when inside the subform ? Do I have to call out the entire form name or is there a simplified standard shortcut.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Me.parent.name
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ScubaBart is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jul 2024
    Posts
    117
    I figured it out. Was preparing to post reply but internet has been wigging lately and went down before I could post.

    Still, thanks.

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

Similar Threads

  1. Replies: 14
    Last Post: 01-31-2019, 09:38 AM
  2. Replies: 1
    Last Post: 04-25-2012, 10:51 AM
  3. Hopefully something simple
    By Andrias14 in forum Forms
    Replies: 2
    Last Post: 03-05-2012, 09:31 AM
  4. A Simple DCount Tbo . . . hopefully!
    By mseeker22 in forum Forms
    Replies: 1
    Last Post: 06-28-2011, 08:42 AM
  5. Hopefully simple If Then
    By fender357 in forum Programming
    Replies: 4
    Last Post: 05-09-2011, 07:52 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