Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL record source error (a2000)

    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
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SQL record source error (a2000)

    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?

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL record source error (a2000)

    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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SQL record source error (a2000)

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •