1
votes

I have an Access database was created, it's working perfectly. After successfully splitting the database to back and front end I shared the _be file in shared drive and front end file in my local, I tried to run the front end and I am getting error when macro is executing:

Macro error

I even put the back and front end in my local machine but still I am getting the error, I tried to remove the macros but still getting errors since I am not the one developed this application.

Dim fdb As Database
Dim utab As Table, otab As Table
DBEngine.SystemDB = "System.mdw"
Set fdb = CurrentDb() 
Set utab = fdb.OpenTable("Users")
Set otab = fdb.OpenTable("Organization")

After tracing the function findorg() I found this error

Item not found in the collection

For this line

Set utab = fdb.OpenTable("Users")

I tried to change the code to be

Set utab = fdb.Rescordsets("Users")

But still I am getting the same error.

Note that I am using back and front end, I have all my tables linked.

2
What does your macro do?citizenkong
macro will call Function findorg() from a modulNoora No
Ok, what does findorg do? Add the code to your question.citizenkong
the question was updatedNoora No
Have you tried stepping through the VBA code to see which line raises the error?citizenkong

2 Answers

0
votes

"Users" table is not linked in the database in which you are running this code. Link it again and check, check for all tables that should also be linked.

0
votes

i was able to solve the issue by using DAO 3.6 object library, as i found that the current database application is using DAO 2.5, so i recompiled the application and fixed all errors. also i managed to rename the functions that's been called by macro, i found that in macro when i write calling function as findorg() will not work, but in function name i specify "findorg" between double quote, which run successfully.