This module works in access 2003 but fails in the runtime version. How can I change it to work with the runtime?
Function AddColumn1()
Dim strConnect As String
Dim strTableName As String
Dim strFieldName As String
Dim db As DAO.Database
Dim tDef As DAO.TableDef
strConnect = CurrentProject.Path
strTableName = "Inventory_Brass"
strFieldName = "QRemaining"
Set db = OpenDatabase(strConnect & "\IData.mdb")
Set tDef = db.TableDefs(strTableName)
With tDef
.Fields.Append .CreateField(strFieldName, [dbLong])
End With
Set tDef = Nothing
Set db = Nothing
End Function
Function AddColumn1()
Dim strConnect As String
Dim strTableName As String
Dim strFieldName As String
Dim db As DAO.Database
Dim tDef As DAO.TableDef
strConnect = CurrentProject.Path
strTableName = "Inventory_Brass"
strFieldName = "QRemaining"
Set db = OpenDatabase(strConnect & "\IData.mdb")
Set tDef = db.TableDefs(strTableName)
With tDef
.Fields.Append .CreateField(strFieldName, [dbLong])
End With
Set tDef = Nothing
Set db = Nothing
End Function