Results 1 to 6 of 6
  1. #1
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    How to combine two docmds to one form

    I have a filter and a bit confused how to combine the filter so that it works with 2 forms. Here is my code:

    Code:
    Option Compare Database
    Option Explicit
    
    Public Function getgraph()
    DoCmd.OpenForm "frmQualityGraph", acFormPivotChart, , GetFilterFromListBoxes
    End Function
    
    Private Sub cmdReport_Click()
    DoCmd.OpenForm "frmSearchQuality", acNormal, , GetFilterFromListBoxes
    getgraph
    DoCmd.close acForm, "frmSearchQualityPrograms", acSavePrompt
    End Sub
    The filter is GetFilterFromListboxes. form SearchQuality displays data from the filter and form QualityGraph is the pivot graph. If I run this, both forms open and update the results fine but if I were to put in a docmd.close acform, "frmQualityGraph", acSavePrompt so that 2nd graph pivot form actually closes, the frmSearchQuality with the embedded PivotChart is displayed but the PivotChart is not updated with results. I have tried to get help with this but the responses confuse me and no one really seems to know how to make this work. I would think something like this should have an easy solution. I have played and played and read and read and to the point now where I think I might just hire someone to figure it out because we are going on 3 wks of trying to make this work.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Closing frmSearchQualityPrograms should effect the filter because frmSearchQualityPrograms holds data that no longer needs to be applied to the filter?

  3. #3
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    I have already tested that theory and whether the frmSearchQualityPrograms is left open or closed, the frmSearchQuality with embedded frmQualityGraph still does not work properly. The graph does appear and it looks nice however the graph does not update the results when embedded. It works fine if I leave 2 separate forms open but that is not how they want it. They want the graph embedded in the frmSearchQuality.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It was a question I was asking. I was not trying to test a theory. I just do not know what you are trying to accomplish.

    In order to adjust properties such as .Filter, you need to fire some code.

    Me.Filter = ""
    Me.Filter = "[MyField] = " & MyVariable

    Perhaps you can include some code with the Docmd.close line to adjust some properties.

  5. #5
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    How about the db. I have a filter to grab data from a main form and since it is just too busy to place graphs and have ability to print on this main form, then when the user clisk on view the report/graph button it takes them to that but right now opens 2 separate items. both are correct but I want 1 item to open and the pivot graph embedded.
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-04-2013, 04:48 AM
  2. combine two tables into one.
    By chad740 in forum Access
    Replies: 2
    Last Post: 08-31-2012, 01:12 PM
  3. Combine table and form view
    By accessnewb in forum Access
    Replies: 1
    Last Post: 08-14-2011, 12:35 PM
  4. Combine the values of two fields on a form
    By nyteowl in forum Access
    Replies: 4
    Last Post: 10-15-2010, 11:16 AM
  5. form formula to combine two fields
    By InvGrp in forum Forms
    Replies: 1
    Last Post: 10-20-2006, 12:10 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