• SQL record source error (a2000)

    Author
    Topic
    #405565

    I’m working with a form for selecting flexible query criteria from a sample database which creates a temporary db to store two tables Criteria and TableFields. The coding is limited to the form itself. There is no external module.

    Opening the form in the sample database generate no error. Opening it in my db generates the following error: Record source ‘Select “*” from rTableFields Union Select FieldName From rTableFiedls;” specificed on this form does not exist.

    It does however create the linked tables in the current database and produce the desired list of tables/queries to use as the record source. I’m guessing the warning has to do in the order of execution in the procedure and that the warning was turned off in the sample database but for some reason isn’t in mine. Does this sound like a reasonable assumption? If so, how do I turn off the warning?

    I’ve attached the code for the form’s procedure here FYI.

    E

    Viewing 1 reply thread
    Author
    Replies
    • #834180

      Open the form in design view.
      Activate the Data tab of the Properties window.
      If there is something in the Record Source property, clear it. (The record source is set in the On Load event, so you don’t need it in design view.)
      Close and save the design.
      Can you open the form normally now?

      • #834379

        ThesGot the form working but wierd stuff. The form works fine in both the sample database and my own as long as I open it via the switchboard and close it via its command button. If I double click the actual form to open it, or switch to design view and back, I immediately start encounting errors starting with Permission denied followed consequtively by Can’t find rCriteriaTable and Can’t find rTableFields. When I close and reopen the form by double clicking it, I get the record source ~sq_cCreateQueryAdvanced-MultiUser ~sql_clstFieldNames ” error. Switching back to opening the form via switchboard and closing re the command button cures the problem.

        Ran into another error. When I imported the required two tables and form into my own database, set up the switchboard to open the form and then selected the combo box that list sall the tables and queries in the database, all worked well. As soon, however, as I selected an object and the After_Update attempted to generate a list of fields in the table or query, I got a type mismatch error. If however, I imported all my objects into the sample database, no such error was generated.

        I donna ken why, but its working. What an ordeal!! Does any of this make sense to you?

        E

        • #834389

          It sounds like some kind of corruption in the database. Importing database objects into a new one is one of the recommended steps to get rid of corruption. Also, compact tha database regularly (Tools | Database Utilities | Compact and Repair).

        • #834390

          It sounds like some kind of corruption in the database. Importing database objects into a new one is one of the recommended steps to get rid of corruption. Also, compact tha database regularly (Tools | Database Utilities | Compact and Repair).

      • #834380

        ThesGot the form working but wierd stuff. The form works fine in both the sample database and my own as long as I open it via the switchboard and close it via its command button. If I double click the actual form to open it, or switch to design view and back, I immediately start encounting errors starting with Permission denied followed consequtively by Can’t find rCriteriaTable and Can’t find rTableFields. When I close and reopen the form by double clicking it, I get the record source ~sq_cCreateQueryAdvanced-MultiUser ~sql_clstFieldNames ” error. Switching back to opening the form via switchboard and closing re the command button cures the problem.

        Ran into another error. When I imported the required two tables and form into my own database, set up the switchboard to open the form and then selected the combo box that list sall the tables and queries in the database, all worked well. As soon, however, as I selected an object and the After_Update attempted to generate a list of fields in the table or query, I got a type mismatch error. If however, I imported all my objects into the sample database, no such error was generated.

        I donna ken why, but its working. What an ordeal!! Does any of this make sense to you?

        E

    • #834181

      Open the form in design view.
      Activate the Data tab of the Properties window.
      If there is something in the Record Source property, clear it. (The record source is set in the On Load event, so you don’t need it in design view.)
      Close and save the design.
      Can you open the form normally now?

    Viewing 1 reply thread
    Reply To: SQL record source error (a2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: