B
Brook
good day all,
I found a calculator for an access db and copied it to my existing db, it
opens fine and everything functions fine except when I try to close the form
I get the following error:
Run-time error "13":
Type Mismatch
when I click the debug button, it goes to the code for the form and
specifically to the *** area...
Private Function ChangeProperty(strPropName As String, varPropType As
Variant, varPropValue As Variant) As Boolean
'Changes the database property passed to the datatype and value passed.
'If the property does not exist an error is generated and the property is
created.
Dim dbMdb As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbMdb = CurrentDb
On Error GoTo Change_Err
dbMdb.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then 'prop not found
***** Set prp = dbMdb.CreateProperty(strPropName, varPropType,
varPropValue)
dbMdb.Properties.Append prp
Resume Next
Else
'unknown error
ChangeProperty = False
Resume Change_Bye
End If
End Function
Does anyone have any ideas suggestions on what might be causing this?
Thanks,
BRook
I found a calculator for an access db and copied it to my existing db, it
opens fine and everything functions fine except when I try to close the form
I get the following error:
Run-time error "13":
Type Mismatch
when I click the debug button, it goes to the code for the form and
specifically to the *** area...
Private Function ChangeProperty(strPropName As String, varPropType As
Variant, varPropValue As Variant) As Boolean
'Changes the database property passed to the datatype and value passed.
'If the property does not exist an error is generated and the property is
created.
Dim dbMdb As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbMdb = CurrentDb
On Error GoTo Change_Err
dbMdb.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then 'prop not found
***** Set prp = dbMdb.CreateProperty(strPropName, varPropType,
varPropValue)
dbMdb.Properties.Append prp
Resume Next
Else
'unknown error
ChangeProperty = False
Resume Change_Bye
End If
End Function
Does anyone have any ideas suggestions on what might be causing this?
Thanks,
BRook