Results 1 to 10 of 10
  1. #1
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Aug 2014
    Posts
    44

    Form Functions properly on its own, but not when used as a subform

    I am having an issue where a form I have created to run a report based on criteria from a dropdown is functioning perfectly. However, when I place the form within another as a subform, the run report button is no longer drawing the query criteria from the dropdown menu, but rather pops up a dialogue box. Why would the form work perfectly by itself, but not as a subform?

    Thanks!

  2. #2
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Aug 2014
    Posts
    44
    Update with more information. I have changed nothing, but for a brief moment in time, It pulled one query properly, then each time I tried to pull another query, the pop up dialogue didnt appear, but it pulled the data from what I selected in the dropdown previously, and not my current selection.

    After closing access and reopening, i can no longer replicate that feat. I am now back to getting the pop up 100% of the time.

    My query criteria is "[Forms]![AgentReportDropdown]![PullAgentReport]", I have verified that the forms and combo box are all named properly.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    When you place the form into another form, as a subform - then the criteria syntax must change:

    [Forms]![MainFormName].[SubFormName].Form![SubFormControlName]

  4. #4
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    I changed the query criteria to the following and am still encountering the exact same issue.

    [Forms]![AgentReportDropdown].[NavigationSubform].[form]![PullAgentReport]

  5. #5
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    for a query to call criteria from a field located in a sub form - it must have the syntax as I posted before. that much is certain

    so either there is a misinterpretation of what you seek to do, or you have a typo or some error in regard to your implementation.....

  6. #6
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    Here is a screen shot of what is occurring. is it because the dropdown is showing as unbound? If so, what to I set as its control source? The control source drop down doesnt have any options for me to select.

    Click image for larger version. 

Name:	10-27-2015 1-12-34 PM.png 
Views:	14 
Size:	35.8 KB 
ID:	22528Click image for larger version. 

Name:	10-27-2015 1-14-05 PM.png 
Views:	14 
Size:	4.1 KB 
ID:	22529

    Click image for larger version. 

Name:	10-27-2015 1-10-45 PM.png 
Views:	14 
Size:	25.5 KB 
ID:	22527

  7. #7
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    well the main form is named Attendance Forms I see in its tab...... and if your sub form is continuous then you can't call a control - though I can't tell if that is the case. I would also copy your objects into a regular form rather than a navigation form.

  8. #8
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    Unfortunately I don't know enough about access to even understand what you just said. =) Back to trial and error I suppose.

  9. #9
    halabis is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    44
    Problem solved.

    I changed the query filter to

    [Forms]![Attendance Forms].[NavigationSubform].[form]![PullAgentReport]

    and everything worked fine.

    Thanks!

  10. #10
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 8 Access 2013
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    TIP: Use TempVars to pass data from a form to a query. This solves many headaches with rm references and the Navigation form.

    See: https://blogs.office.com/2010/09/27/...2007-and-2010/
    Boyd Trimmell aka Hitechcoach
    Database Architect and Problem Solver
    Microsoft MVP - Access Expert
    25+ years specializing in Accounting, Inventory, and CRM systems
    "If technology doesn't work for people, then it doesn't work."

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

Similar Threads

  1. Replies: 31
    Last Post: 10-20-2015, 04:45 PM
  2. Subform Not Filtering Properly
    By pmontalt in forum Reports
    Replies: 3
    Last Post: 07-08-2014, 12:28 PM
  3. Continous form, not updating properly?
    By g4tv4life in forum Programming
    Replies: 4
    Last Post: 04-22-2014, 10:55 AM
  4. Subform isn't filtering properly
    By Access_Novice in forum Forms
    Replies: 3
    Last Post: 11-29-2013, 12:44 PM
  5. Replies: 0
    Last Post: 10-11-2010, 02:40 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