Results 1 to 10 of 10
  1. #1
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110

    Query Criteria based on Navigation Button

    I have a form with a series of navigation buttons. Each button has the same form loaded into it. The form is based on a query who's criteria I would like to change based on which Navigation button is selected but I haven't the foggiest idea how to accomplish this. Any ideas?



    Thank you.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What do you mean by 'Navigation button' - this a Navigation form? Why duplicates of the same form? Why not just filter one 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.

  3. #3
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    I know nothing about filtering. My idea was to create a Navigation form and figure out a way to change the criteria of a query based on which tab was selected.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    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.

  5. #5
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    I'm familiar with that method described there, but I don't know how to use those concepts in a navigation form. A combobox can be bound to a field that passes a UID into the query. But if reference a Navigation button in a query that button doesn't contain any data to pass into the query to act as a criteria.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    And I have never made use of a Navigation form. There must be some way to apply filter criteria to subform.

    I still don't understand why you would duplicate subform. Maybe seeing will help. 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.

  7. #7
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    Marketers' Weekly Activity Report.zip

    Primary Data is in tblPanelData. All forms (except frmMain and frmCombined) are based on qryPanelData, they pull the appropriate columns out of qryPanelData. I will then put all those forms into frmCombined, which I place into each tab of the Navigation form frmMain. Please excuse the poor table structure, this needs to be a quick and dirty project. As far as the forms.....I honestly don't know what I'm doing there, lol.

    Thank you.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Okay, I see it and I think I understand what you want. You want to offer an easy way for user to view records associated with each office location. To accomplish this you have a tab for each location. User would click tab and view that location records. I expect code would have to set the RecordSource or Filter property of the subforms. This is a complicated structure I would not use and have never seen from anyone else. Also, if you add a new location, have to modify form design.

    I don't understand the subforms. What is the significance of the names? As you said, they all have the same data source and if you want the records on each tab to display only that location's records, why are the subform names not the locations? And why are there two subforms on each tab?

    Why have you chosen this approach? The example in the link I referenced is more conventional solution.

    I would do a form/subform setup http://office.microsoft.com/en-us/ac...010098674.aspx

    The main form would be bound to tblOffices (actually a parameterized query of that table) and subform would be bound to tblPanelData. Then method demonstrated in first tutorial would filter the main form to desired location.

    You want 'quick' then you are going down the wrong path.
    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
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    This database is going to be replacing an Excel sheet for 9-12 months until we purchase a Customer Relationship Management package. For the time being I'm supposed to make the interface of the database mimic the way the Excel sheet was setup. In the Excel sheet, each location had a tab, each tab was the same layout and was divided into sections. The way I see it, each section of the Excel sheet needs to be translated into its own subform. The significance of the names of the subforms is they are the titles of the sections from the Excel sheet. There's only 2 subforms in each tab for now just because I haven't finished yet, I'm just trying to figure out if my concept is feasible before I go through with the grunt work of adding every subform.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    AFAIK, easiest way to replicate the Excel and virtually eliminate code and get this done quick would be either:

    1. a separate table for each location (which is not optimized structure for a relational database)
    2. a single table that is filtered for the desired location

    and then for either of the above, a form for each location, not one form used multiple times, but multiple forms, each with its own SQL statement as RecordSource, copy/paste form then change the RecordSource - and in the case of 2 above, include a static filter parameter
    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. Query for table, based on criteria from other tables
    By PureLoneWolf in forum Queries
    Replies: 2
    Last Post: 10-04-2012, 11:23 AM
  2. Navigation subform Query Criteria
    By RayMilhon in forum Queries
    Replies: 2
    Last Post: 08-10-2012, 01:26 PM
  3. Replies: 2
    Last Post: 03-22-2012, 01:01 AM
  4. data field in query twice based on criteria
    By sandyg in forum Queries
    Replies: 1
    Last Post: 09-29-2011, 07:47 AM
  5. query - criteria based on another row field value
    By techexpressinc in forum Queries
    Replies: 1
    Last Post: 05-29-2009, 04:17 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