Results 1 to 4 of 4
  1. #1
    Kent Bestle is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2016
    Posts
    6

    Broken query parameter

    I have been using Access since the beginning and I have never encountered this before. I have a button on a form that opens a query. The query has a parameter set using Forms!myform!myfield to filter the records. This keeps breaking, in that it no longer recognizes the field on the form. If I change the myfield in the query to a new reference and change the name of the field on the form to the new reference all works fine, until I close the form and reopen. Then it no longer works. I can again change the reference and it works fine again, until I close the form.

    Anyone have any clues why this keeps breaking. I have run Compact and Repair.



    TIA

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    The query that has the form referenced in its WHERE clause, are other queries dependent on it?

    You will want to back up your work.

    I suggest doing a compact and repair after deleting the problem query and the form. I am going to guess it has something to do with a bad record in one or more of the system tables. So it is not understanding the name of the query and or form.

    Back up your query object, or objects in case there are dependent queries, by copying the SQL to a text file. The form is probably not corrupt, so I do not believe you will need to rebuild your form. Just delete the form.

    Once the objects are deleted, do a compact and repair. Import your form. Rebuild your query object. Do a compact and repair.

  3. #3
    Kent Bestle is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2016
    Posts
    6
    I suspected recreating the form and query would do it, I was just hoping to avoid doing that.

    Thanks

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Try it with just importing a copy of the form and recreate only the query.

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

Similar Threads

  1. Replies: 8
    Last Post: 09-07-2016, 08:52 AM
  2. Broken Form/Dynamic Query Help
    By sh3p in forum Forms
    Replies: 3
    Last Post: 03-06-2015, 03:59 PM
  3. Broken Query
    By ThatSkepTicGuy in forum Queries
    Replies: 3
    Last Post: 09-25-2012, 09:43 AM
  4. Broken Query
    By lkevinc42036 in forum Access
    Replies: 9
    Last Post: 08-06-2012, 09:29 AM
  5. Update query has broken
    By eskapades in forum Queries
    Replies: 1
    Last Post: 07-11-2011, 03:52 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