Results 1 to 9 of 9
  1. #1
    rscott7706 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Lakeside Ca
    Posts
    24

    Controls don't work on subforms

    I have (I feel throughly) searched and cannot find a post on this.



    I don't know if I am doing something wrong, but Find buttons or List boxes designed to select records work fine in the original forms, but if I attach them through a subform, they don't.

    For instance I have a form named Chamber Entry Form. It is based on a table called the same thing. If I put a Find button or list box on it, they work fine - no problem.

    But, when I build tabs, and place my forms on as a subform, the controls no longer work.

    Am I crazy or is this solvable?

    Ron

  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,518
    What is the code used? From the sound of it, you need to adjust the form reference to account for it being a subform:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rscott7706 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Lakeside Ca
    Posts
    24

    Controls don't work on subforms

    Thank you for your response, I went a completely different way, and the work is done.

    Basically I used a free download from a very nice guy that built neat chamber of commerce based database.

    But in some respect as I am not a coder in Access (I use the wizards), I would like to see a solution to my dilemma in the future.

    Here is what I did:

    I built a form called "Chamber Entry Form", I attached it to our main database called "Company_Info". I then built tabs for table things like "Contacts", "Dues", "Parade", "Golf", etc.

    On each of those tabs, I placed subforms using the tool bar. I then linked them to the various tables described above. I then put a command button on the subform and using the wizard made it a "Find Record" button.

    Now, it worked fine on the first "Company_Info table, but would not work on any of the other tabs (even if I completely rebuilt them from scratch on that tab). This throws me, because I would feel a subform is just a window back to the form referenced on that tab.

    I tried putting the command button in the header, and outside the subform, but to no avail.

    I know this is very infantile in nature and is not how most coders describe things, but it is the only way I can explain exactly what I did.

    Again though thanks for your response, I hope to get better at Access in the future.

    Ron

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What is the code behind a button that doesn't work?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    rscott7706 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Lakeside Ca
    Posts
    24

    Controls don't work on subforms

    Quote Originally Posted by pbaldy View Post
    What is the code behind a button that doesn't work?
    I apologize, but I only am able to see the properties - how do I view the "code"?

    On the properties, there is little to go on, just an event progedure" and it does not seem to be hooked to anything.

    Sorry to be such a dunce at Access.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Click in the line that says Event Procedure, and then you should see the ellipsis (...) to the right. Click there and you should be taken into the VBA editor in the code for that event.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    rscott7706 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Lakeside Ca
    Posts
    24

    Controls don't work on subforms

    Quote Originally Posted by pbaldy View Post
    Click in the line that says Event Procedure, and then you should see the ellipsis (...) to the right. Click there and you should be taken into the VBA editor in the code for that event.
    Private Sub Command243_Click()
    On Error GoTo Err_Command243_Click


    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

    Exit_Command243_Click:
    Exit Sub

    Err_Command243_Click:
    MsgBox Err.Description
    Resume Exit_Command243_Click

    End Sub

    Ron

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Hmm; it's not what I would do, but should still work. The button is on the same subform? Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    rscott7706 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Lakeside Ca
    Posts
    24
    Quote Originally Posted by pbaldy View Post
    Hmm; it's not what I would do, but should still work. The button is on the same subform? Can you post the db?
    Sorry, went off to dinner and did not log off.

    There are so many tables with sensitive information and if I strip them, it would effect you using the search function to feel the problem.

    I do so appreciate your offer of help, but let's let this one go.

    I just went a different way, so solving this one is not worth the time at this juncture.

    Please, please don't give up on me though - I think I need to learn some ACCESS coding before I bother you folks.

    Ron

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

Similar Threads

  1. calendar controls
    By kganomega in forum Access
    Replies: 0
    Last Post: 12-16-2009, 12:34 PM
  2. subform controls hidden
    By bkelly in forum Forms
    Replies: 0
    Last Post: 09-26-2009, 10:12 AM
  3. Accessing form controls
    By dante in forum Forms
    Replies: 15
    Last Post: 07-28-2009, 08:26 AM
  4. Referring to fields in tab controls
    By AndrewAfresh in forum Forms
    Replies: 1
    Last Post: 06-03-2006, 05:10 PM
  5. Adding Controls to a Form
    By msmayhew in forum Programming
    Replies: 7
    Last Post: 12-14-2005, 03:26 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