C
Charles in Iraq
Greetings.
I manage an event database for foot races.
I have written VBA code to allow users to set the default
length of the race. But everytime I attempt to execute the
code, I get the following error:
Run-time error '3420'
Object invalid or no longer set.
Here is the VBA code that executes:
Private Sub Length_AfterUpdate()
Dim RunTab As DAO.TableDef
Dim LgthFld As Field
Set RunTab = CurrentDb.TableDefs("runners")
Set LgthFld = RunTab("Length") <-- ERROR OCCURS HERE
LgthFld.DefaultValue = Me.Length
End Sub
Can somebody tell me why I'm getting this error and what
I can do to fix it?
Respectfully,
Charles
I manage an event database for foot races.
I have written VBA code to allow users to set the default
length of the race. But everytime I attempt to execute the
code, I get the following error:
Run-time error '3420'
Object invalid or no longer set.
Here is the VBA code that executes:
Private Sub Length_AfterUpdate()
Dim RunTab As DAO.TableDef
Dim LgthFld As Field
Set RunTab = CurrentDb.TableDefs("runners")
Set LgthFld = RunTab("Length") <-- ERROR OCCURS HERE
LgthFld.DefaultValue = Me.Length
End Sub
Can somebody tell me why I'm getting this error and what
I can do to fix it?
Respectfully,
Charles