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.
Dim db as dao.database
dim tbl as dao.table
dim prop as dao.property
set db = currentdb
set tbl = db.tabledefs("
YourTable
")
set prop = tbl.Properties("OrderBy")
prop.Value = "
YourSortField
"
Sub CreateProps()
Dim tjDb As DAO.Database
Dim tjTab As DAO.TableDef
Dim tjProp As DAO.Property
Dim existsOrderBy As Boolean
Dim existsOrderByOn As Boolean
Set tjDb = CurrentDb
Set tjTab = tjDb.TableDefs!
YourTable
For Each tjProp In tjTab.Properties
If tjProp.Name = "OrderBy" Then existsOrderBy = True
If tjProp.Name = "OrderByOn" Then existsOrderByOn = True
Next
If Not existsOrderBy Then
Set tjProp = tjTab.CreateProperty("OrderBy", dbMemo)
tjProp.Value = tjTab.Fields(1).Name
tjTab.Properties.Append tjProp
End If
If Not existsOrderByOn Then
Set tjProp = tjTab.CreateProperty("OrderByOn", dbBoolean)
tjProp.Value = False
tjTab.Properties.Append tjProp
End If
tjDb.Close
Set tjProp = Nothing
Set tjTab = Nothing
Set tjDb = Nothing
End Sub