Results 1 to 6 of 6
  1. #1
    AmyMouse is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    4

    Embedded query on form stopped returning parameter - what changed?

    Sorry if this is a repeat - I looked for similar threads and haven't found any that match. Also, not sure which is the best forum since this involves queries, forms and some limited programming. I'm fairly new to Access, not a lot of experience with code but willing to learn.
    I'm building a (simple) database to keep track of training materials and any maintenance information related to them - our spreadsheets were not quite adequate for the purpose. We have a number of different training items (in an Items table). They may be part of any one of several projects based on role or application (listed in the Projects table and linked to the Items table).
    There are currently 2 forms for the end users, SearchItems (to locate the desired training item) and Item Details (to input/edit maintenance info on a training item). It took a while to get the SearchItems form working. It has 2 combo boxes, pulling from the Projects table and the Items table. Both use embedded queries for row source. The user selects the desired project and then selects the desired item. The query for the Items combo box filters results based on the project selected in the Project combo box. There are 2 buttons, one to clear the form and one to open the selected item (it opens the desired record from the Item Details form).
    All this was (finally!) working together beautifully. I made a copy database which allows me to make changes without impacting the original. A Navigation form was added (intended to be the main UI for end users), and the Search Items was added to that. The SearchItems form continued to work on its own but not when opened from the Navigation form. Next step was to remove the Navigation form from the copy database. SearchItems form continued to work. I tried adding a new button to the bottom of the form that would allow for a different form to be opened. On adding this new button, without changing properties on the original 2 combo boxes and 2 buttons. the functionality that existed between those several objects was broken. Now when the Items combo box is selected, the form asks for the parameter that should be given by the Projects combo box.
    I tried deleting all objects on the SearchItems form and building them again - didn't work.
    I even made another copy of the database from the (still working) original and that broke also (when I enabled content).
    I'm hoping someone else has seen something similar and can tell me what I'm doing wrong...
    Thanks for your help!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Remember, never rename objects once you program them. Never rebuild if already working.

    I think your queries may be out of 'sync'.
    Before,.. they all had parameters for the 1st forms built. Did you change the queries to the new forms built?
    If you renamed a form, or object on the form, all the queries will be broken and need params using the new forms.

    The main UI should have had buttons to open the working forms.

  3. #3
    AmyMouse is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    4
    Thanks for the quick response, ranman.
    For the original form and query, I don't think I actually renamed anything while it was working. When they stopped working, I first tested the existing buttons and combo boxes to see where the queries broke. I simply couldn't find the reason for the second embedded query not to retrieve the project ID from the first combo box, especially since this had worked before. That's when I wiped all the objects and started again. I think I have learned not to add new functionality to a working form, though. I think your suggestion on using buttons with the UI will be helpful - if I can get a working copy again.
    Re: your question about changing queries to the new forms built, I'm not sure I understand what you're asking? The queries were still embedded in the SearchItems form when I called it from the Navigation form. Would the queries need to be changed in that instance?
    I would like to try your suggestion of using buttons on the Navigation form. First I need to get a working copy database again; I don't want to risk breaking the (still functional) original. Any suggestions on making an identical copy of a database? When I copy to a new database, I get a message in the new DB that some of the content has been disabled. If I leave it, the combo boxes and "Open Item" button in the SearchItems form work but the "Clear Form" button does not. If I enable content, that breaks the embedded query that delivers the parameters for the second combo box. In either instance, the form in the copy database no longer works as it does in the original.

  4. #4
    AmyMouse is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    4
    OK - created a new DB & copied all the objects into it instead of trying to create a copy of the original. The SearchItems form works in the "new" copy. Still perplexed as to what caused the issue in the first place. I'll try your suggestion for the UI.

  5. #5
    AmyMouse is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    4
    Follow-up: "New" copy of the DB gave a security message after it was closed and reopened, but enabling content did not disrupt the SearchItems form this time. Added the button-based UI form (Main) per ranman256's suggestion; Main and original forms still working (crossing fingers and creating a backup).
    Would still love to find out what triggered the issues in the first place but no further problems at this point.

  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,626
    Sometimes corruption inexplicably happens and nothing but rebuilding at some level will resolve.
    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: 8
    Last Post: 11-02-2014, 01:27 AM
  2. Embedded Form Suddenly Stopped Working
    By ResearchRN in forum Access
    Replies: 3
    Last Post: 03-14-2014, 07:19 AM
  3. Command Buttons Stopped Working on Form
    By genest11 in forum Reports
    Replies: 12
    Last Post: 02-06-2013, 06:59 AM
  4. Form stopped working in new year?
    By daniejm in forum Forms
    Replies: 14
    Last Post: 01-04-2013, 01:41 PM
  5. Replies: 1
    Last Post: 11-21-2010, 02:20 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