Hi,
I have an Access 2010 library accde database of functions and tools which I want to distribute to a team of developers, so that they can add a reference to the accde in their applications and call the functions within.
One of the functions opens an unbound form, also contained in the library database. Although the form is unbound, the load event opens a recordset based on a table in the library database, tbl_Settings, and uses it to calculate some values on the form. The line of code that defines the recordset is
Set rs = CurrentDb.OpenRecordset("tbl_Settings")
This all works perfectly if I open the accde file itself and run the function. However, if I create a new access db, add a reference to the library database and then call the function, the form opens but I then get runtime error 3078 saying the Microsoft Access database engine cannot find the input table or query 'tbl_Settings'. Presumably this is because tbl_Settings resides in the library database, and not the one which is actually running the code.
Can someone please tell me if it is possible to write the code so that it looks for tbl_Settings in the accde rather than in the database which is calling the function?
I hope all that makes sense! As always, many thanks for reading and for any help you can give,
Jim
I have an Access 2010 library accde database of functions and tools which I want to distribute to a team of developers, so that they can add a reference to the accde in their applications and call the functions within.
One of the functions opens an unbound form, also contained in the library database. Although the form is unbound, the load event opens a recordset based on a table in the library database, tbl_Settings, and uses it to calculate some values on the form. The line of code that defines the recordset is
Set rs = CurrentDb.OpenRecordset("tbl_Settings")
This all works perfectly if I open the accde file itself and run the function. However, if I create a new access db, add a reference to the library database and then call the function, the form opens but I then get runtime error 3078 saying the Microsoft Access database engine cannot find the input table or query 'tbl_Settings'. Presumably this is because tbl_Settings resides in the library database, and not the one which is actually running the code.
Can someone please tell me if it is possible to write the code so that it looks for tbl_Settings in the accde rather than in the database which is calling the function?
I hope all that makes sense! As always, many thanks for reading and for any help you can give,
Jim