1

I'be been given a MA DB and I had to connect that to a MySQL server using ODBC. That was fine. Then I added a subform in the main form that shows all the "attachfiles" related to the main form. That looks fine too. I even created a button to add a new record of attachfile (I save only the path on the table) related to the current form (to the current object that is editable with the form). And another button that deletes all this records related to the current main form. It all looks fine.

But then when I try to create a new record of the main form it complains, runtime error 2105, you can't go to the specified record.And it highlights this line:

DoCmd.GoToRecord , , acNewRec

Why does that happen? With the DB that I was given, it adds a new record with no problem (but there was no subform and tables weren't linked). I am totally new to VBA and I am not sure if the problem is more for using the connector to MySQL or for the modifications I did. I am quite lost.

Any directions?

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
Cesc
  • 648
  • 1
  • 11
  • 22
  • 1
    The form is now bound to a linked table? That is, the `Record Source` of the form is now the name of a linked table that appears in the list of "Tables" in the Navigation Pane of Access and has the ODBC icon (little globe with an arrow pointing to it)? – Gord Thompson Oct 18 '13 at 08:36
  • @GordThompson Oh my, no it wasn't. Since when I copied the tables to MySQL they all changed names by generic ones like DTable1 and so on. I changed the "Record Source" with the current name of the table and now I can add with no problem. I'll just need to check that attribute for the rest of the forms. Thanks! – Cesc Oct 18 '13 at 09:22

1 Answers1

3

Double-check that the Record Source property of the form points to a valid linked table in the database. Sometimes when converting from local tables to linked tables the names can get muddled up (e.g., [Invoices] vs. [Invoices1]).

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418