LittleSmudge
Programmer
I'm following the code supplied in the help file that has worked on many other dbs, but I can't get it to work on this one ( Access 2002 is it matters )
Code:
...
ChangeProperty "AllowBypassKey", dbBoolean, False
...
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database
Dim prp As Property
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err.Number = 3270 Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
The 3270 error duly occurs and on the Set prp = line I get an
Error 13 : Type Missmatch
I know varPropType = 1 ( Boolean ) & varPropValue = False
I can't seen to fathom out what is going wrong
Any ideas ?
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.