Results 1 to 8 of 8
  1. #1
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393

    Subforms 101


    I have just started using my first subform and I cannot seem to apply everything I have learnt up to this time when using the subform and main form

    I figure it is the same problem however I am stuck on a number of things such as passing values to other forms, getting combo boxes to work, assigning values and code to the subform, hiding and showing the subform, etc

    Previously I have been using code such as

    Me.Field1.Visible=True

    and

    Forms!frmSubForm1.Field1.Visible=True (to other forms or using value from other forms)

    however these don't work when using a subform as it cannot find the form any quick advice as I think this may solve many of my subform problems.

    I tried making the code public (removing private) but this didn't work

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    thanks pbaldy actually on this page at the moment thanks to post before mine have figured out most things now--> 2 that are causing me a bit of trouble are
    1) how to use it in an sql query where I would use

    WHERE (((tblThis.ThisID)=[forms]![frmSubform1]![cmbThis]))

    and

    2) how to make the whole subform invisible and then visible

    using something like

    Me!frmSubform1!Form!Visible = False

    from main form

    Thanks, this is a great resource

  4. #4
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    I worked it out I think my subform had the wrong name... idiot

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Not quite solved how do you write

    Forms!Mainform!Subform1.Form!ControlName

    as SQL (not VB)

    still can't get question 1 to work in normal SQL

    Thanks

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    That should work in SQL. The form has to be open, if it isn't.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Thanks, I think my problem is somewhere else

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

Similar Threads

  1. subforms
    By agmorgan in forum Access
    Replies: 1
    Last Post: 08-08-2011, 06:32 AM
  2. Subforms
    By fwillia in forum Access
    Replies: 2
    Last Post: 09-24-2010, 08:03 AM
  3. subforms
    By thewabit in forum Forms
    Replies: 6
    Last Post: 02-01-2010, 09:03 PM
  4. Help with subforms
    By chocpoc in forum Forms
    Replies: 0
    Last Post: 05-20-2009, 11:50 PM
  5. Subforms
    By henryclay in forum Access
    Replies: 0
    Last Post: 07-24-2007, 07:51 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