J
JGPatrick
I would appreciate it if someone would explain to me why the subs Prac4 and
Prac5 below work, but Prac6 does not. The error is in the debug.print
statement, not the Set statement.
Sub Prac4()
Dim FldName As String
FldName = CurrentDb().TableDefs(0).Fields(0).Name
Debug.Print FldName
End Sub
Sub Prac5()
Dim Dbs As DAO.Database
Set Dbs = CurrentDb()
Debug.Print Dbs.Name
End Sub
Sub Prac6()
Dim Fld As DAO.Field
Set Fld = CurrentDb().TableDefs(0).Fields(0)
Debug.Print Fld.Name
End Sub
Prac5 below work, but Prac6 does not. The error is in the debug.print
statement, not the Set statement.
Sub Prac4()
Dim FldName As String
FldName = CurrentDb().TableDefs(0).Fields(0).Name
Debug.Print FldName
End Sub
Sub Prac5()
Dim Dbs As DAO.Database
Set Dbs = CurrentDb()
Debug.Print Dbs.Name
End Sub
Sub Prac6()
Dim Fld As DAO.Field
Set Fld = CurrentDb().TableDefs(0).Fields(0)
Debug.Print Fld.Name
End Sub