I have a database with a procedure that creates a new database and sends information from the source database to the new one. Everything is working fine, except I need to perform an process on both the source and destination database (a renumbering process). Since I have two databases to perform this operation on, I want to use the same code process for both, and pass each database to the procedure. I am getting a Type Mismatch error when I try.
Code - this is for one of the calls, both are essentiall the same, I've left out the non-pertinent parts:
{Procedure that passes the argument}
Private Sub CleanCurrentDb()
Dim Dbs As Database
Dim strSql As String
Set Dbs = CurrentDb
----------
----------
----------
RenumberRecords (Dbs) - this is where the error occurs
----------
----------
end sub
{procedure that receives the argument}
Private Sub RenumberRecords(dbsrenum As Database)
----------
----------
end sub
Either passing a database as an argument doesn't work, or I'm doing something wrong. Any assistance is appreciated.
Code - this is for one of the calls, both are essentiall the same, I've left out the non-pertinent parts:
{Procedure that passes the argument}
Private Sub CleanCurrentDb()
Dim Dbs As Database
Dim strSql As String
Set Dbs = CurrentDb
----------
----------
----------
RenumberRecords (Dbs) - this is where the error occurs
----------
----------
end sub
{procedure that receives the argument}
Private Sub RenumberRecords(dbsrenum As Database)
----------
----------
end sub
Either passing a database as an argument doesn't work, or I'm doing something wrong. Any assistance is appreciated.