I am trying to run an access module that changes the row/record height of a table (table name = "Filtered"). I'm not sure where I am going wrong. The program runs fine but the row heights are never changed.
Here is my code
Note: I got 'SetTableProperty' from the Access Help
THANKS!!!
Here is my code
Code:
Sub rowheight()
Dim dbs As DAO.Database, rst As DAO.Recordset
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("Filtered")
SetTableProperty dbs![Filtered], "RowHeight", dblong, 900
DoCmd.OpenTable "Filtered", acViewNormal
End Sub
Sub SetTableProperty(tdfTableObj As TableDef, strPropertyName As String, _
intPropertyType As Integer, varPropertyValue As Variant)
' Set Microsoft Access-defined table property without causing
' nonrecoverable run-time error.
Const conErrPropertyNotFound = 3270
Dim prpProperty As Property
On Error Resume Next ' Don't trap errors.
tdfTableObj.Properties(strPropertyName) = varPropertyValue
If Err <> 0 Then ' Error occurred when value set.
If Err <> conErrPropertyNotFound Then
On Error GoTo 0
MsgBox "Couldn't set property '" & strPropertyName _
& "' on table '" & tdfTableObj.Name & "'", 48, "SetTableProperty"
Else
On Error GoTo 0
Set prpProperty = tdfTableObj.CreateProperty(strPropertyName, _
intPropertyType, varPropertyValue)
tdfTableObj.Properties.Append prpProperty
End If
End If
tdfTableObj.Properties.Refresh
End Sub
Note: I got 'SetTableProperty' from the Access Help
THANKS!!!