E
EagleOne
2003
Had to divide some code to a sub-routine.
In the master code procedure the code-setup is the following:
Sub mySub()
.....
.....
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.NewCurrentDatabase myPath & dbsfilename
' Get Database object variable.
Set dBs = appAccess.CurrentDb
.....
.....
Call mySubSub()
.....
.....
End Sub
Sub mySubSub()
dBs.Execute "Alter Table ........."
End Sub
When the code dBs.Execute "Alter Table ........." is read, I get a Error 424. Obvious;y,
"dBs" has lost its object meaning in the Called sub-routine.
What is the preferred fix for the above?
I thought about issuing the SET command again, but I think that there must be a better fix.
TIA EagleOne
Had to divide some code to a sub-routine.
In the master code procedure the code-setup is the following:
Sub mySub()
.....
.....
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.NewCurrentDatabase myPath & dbsfilename
' Get Database object variable.
Set dBs = appAccess.CurrentDb
.....
.....
Call mySubSub()
.....
.....
End Sub
Sub mySubSub()
dBs.Execute "Alter Table ........."
End Sub
When the code dBs.Execute "Alter Table ........." is read, I get a Error 424. Obvious;y,
"dBs" has lost its object meaning in the Called sub-routine.
What is the preferred fix for the above?
I thought about issuing the SET command again, but I think that there must be a better fix.
TIA EagleOne