Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub SetProperty()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Dim strNewCap As String
Dim strName As String
On Error GoTo Err_Property
strNewCap = "New Caption"
strName = "Caption"
Set db = CurrentDb
Set fld = db.TableDefs("Table1").Fields("ID")
fld.Properties(strName) = strNewCap
Debug.Print fld.Properties("Caption")
On Error GoTo 0
Exit Sub
Err_Property:
' Error 3270 means that the property was not found.
If DBEngine.Errors(0).Number = 3270 Then
' Create property, set its value, and append it to the
' Properties collection.
Set prp = fld.CreateProperty(strName, _
dbText, strNewCap)
fld.Properties.Append prp
Resume Next
End If
End Sub