Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18

    Question Subform within Navigation form won't work

    I have a database that links people by their username in one table to items that they own in several other tables. I am using a form called SearchForm with a Combo Box to display this information. I want to create a form that can house many forms, including SearchForm. Navigation form is what I want to use to complete this. However, when I drag SearchForm to the [Add New] tab in a blank Navigation form template, I get the following message:

    Click image for larger version. 

Name:	error1.PNG 
Views:	14 
Size:	2.6 KB 
ID:	21417

    This happens every time I try to open the Navigation form called MainForm. I do not get this message when opening SearchForm by itself. I don't even recall ever setting a parameter of Forms!SearchForm!Combo25 anywhere specifically. Of course, if I enter the person's username in this box THEN the SearchForm works inside of MainForm. But this is not desirable. I've looked through the small amount of VB code in SearchForm and I can't seem to figure out how to get SearchForm to work normally inside MainForm.

    Here is the VB code that makes the Combo Box work for SearchForm:


    Code:
    Private Sub Combo25_AfterUpdate()Me.Requery
    End Sub
    Combo25 operates based on the following query:
    Code:
    SELECT Users.Username, Users.[Last Name], Users.[First Name], Users.DepartmentFROM Users
    ORDER BY Users.[Last Name], Users.[First Name], Users.Department, Users.Username;
    There is currently no VB code in MainForm. Could anyone help me out here? I've tried various different variations of Me.Requery. I tried code that makes the subform point to the MainForm with no luck.

    Any guidance would be appreciated. Thanks!

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Are you using SearchForm as a subform on Mainform? If so, then you cannot use the notation Forms!Searchform to refer to it, because subforms are not a part of the Forms! collection.

    Instead, use Mainform.subformcontainer.form!Combo25 to refer to the combo box. subformcontainer is the name of the subform control on the main form. Notice that you do not refer to the subform by its name, Searchform.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If you are using Navigation form/control, referencing subforms seems to be different than on normal form. Review https://www.accessforums.net/forms/t...orm-32053.html

    I don't like and don't use Navigation form.
    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.

  4. #4
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    Quote Originally Posted by John_G View Post
    Are you using SearchForm as a subform on Mainform? If so, then you cannot use the notation Forms!Searchform to refer to it, because subforms are not a part of the Forms! collection.

    Instead, use Mainform.subformcontainer.form!Combo25 to refer to the combo box. subformcontainer is the name of the subform control on the main form. Notice that you do not refer to the subform by its name, Searchform.
    Do you mind me asking where I put Mainform.subformcontainer.form!Combo25? Do I put in in the VB for SearchForm or MainForm? Editing Combo25 in MainForm brings me to edit SearchForm, so there is no separate control for the Combo Box in MainForm.

  5. #5
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    Also, where do I find this so called parameter "Forms!SearchForm!Combo25"? I never actually entered this information. The query for the Combo Box does not have any criteria associated with any of its fields.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The parameter pops up because Access can't find the control. Did you review link in post 3? Are you using a Navigation form?
    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.

  7. #7
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    Quote Originally Posted by June7 View Post
    The parameter pops up because Access can't find the control. Did you review link in post 3? Are you using a Navigation form?
    I did review the link. I am trying to use a Navigation form. So you are certain that there is no way possible for this very simple form with a combo box to work within a Navigation form? Would you suggest different method? I am relatively new to Access, so I am not sure how to make an equivalent navigation-type form from scratch.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I am not certain won't work, but all my efforts helping posters with Navigation form have been frustrating. I have never implemented Navigation form. I use form with Tab control.
    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.

  9. #9
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    Quote Originally Posted by June7 View Post
    I am not certain won't work, but all my efforts helping posters with Navigation form have been frustrating. I have never implemented Navigation form. I use form with Tab control.
    So I tried it with the tabbed form and I am having the same exact problem: I get that same message. This does not appear to be directly related to the Navigation form in that case. I do not understand why such a simple form with one combo box would not work when embedded within another form.

  10. #10
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    This is what the debugger tells me:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	10 
Size:	9.8 KB 
ID:	21425

    I have tried every Google solution for rewriting this line with no luck.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You want to requery the subform?
    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.

  12. #12
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    Quote Originally Posted by June7 View Post
    You want to requery the subform?
    In the original form that actually works, I need that line so when I choose a different selection from the combo box, the form updates accordingly.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The combobox is UNBOUND for input of search criteria?

    Does this help http://www.allenbrowne.com/ser-62.html
    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.

  14. #14
    revolution9540 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    18
    Quote Originally Posted by June7 View Post
    The combobox is UNBOUND for input of search criteria?

    Does this help http://www.allenbrowne.com/ser-62.html
    Yes, the combo box is unbound. And no, that link does not provide any help unfortunately.

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That tutorial is a well-used example of a search utility.

    Exactly how is the combobox used to filter subform records? Dynamic parameterized query (I NEVER use them) or code that applies criteria to form Filter property (you don't show any such code) as in the referenced tutorial?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-09-2014, 02:38 PM
  2. Replies: 4
    Last Post: 11-06-2014, 05:35 AM
  3. Replies: 12
    Last Post: 10-23-2014, 02:08 AM
  4. Reference Subform on Navigation Form
    By GOP in forum Forms
    Replies: 1
    Last Post: 07-30-2014, 08:18 AM
  5. Navigation Form used as SubForm
    By jlgray0127 in forum Forms
    Replies: 2
    Last Post: 03-26-2014, 10:28 AM

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