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.
Function TableMake(MyTable As String)
Dim db As Database
Dim tName As String
Dim test As String, strSQL As String
Dim td As TableDef, fld As Field
'Dim prp As Property
Set db = CurrentDb
'Trap for any errors.
On Error Resume Next
tName = MyTable
'Does table MyTable exist? If so, delete it;
test = db.TableDefs(tName).Name
If Err <> 3265 Then
DoCmd.DeleteObject acTable, tName
End If
'Create/recreate table
strSQL = "CREATE TABLE " & tName & "(ObjectID counter, Type TEXT (55), " _
& "FileName TEXT (55), Selected YESNO);"
db.Execute strSQL
Set td = db.TableDefs(tName)
' Add autonumber field
Set fld = td.Fields("ObjectID")
fld.Attributes = dbAutoIncrField
db.TableDefs.Append td
db.TableDefs.Refresh
' Make ObjectID the key field
db.Execute "CREATE INDEX NewIndex ON " & tName & " (ObjectID) WITH PRIMARY;"
End Function