Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top