Calendrier Lebans

M

Monkeytoo

Dans une application, j'utilise le calendrier propopé sur le site Lebans.
Or depuis peu de temps, à l'ouverture du formulaire utilisant les fonctions
de création du calendrier, j'obtiens l'erreur 3270 : Propriété non trouvée.
Si je vais en débogage, l'erreur se situe à ce niveau :

Private Function GetProperty(ByVal strPropName As String, ByRef strPropValue
As Variant) As Boolean
' Changed strPropValue as String to as Variant

Const cProcedureName As String = "GetProperty"
On Error GoTo Err_Handler
Dim db As DAO.Database

Set db = CurrentDb
strPropValue = db.Properties(strPropName) L'ERREUR EST ICI
GetProperty = True

Sur une autre machine, le programme fonctionne correctement.
Je n'y comprends rien.
Merci de votre aide
 
S

Stephen Lebans

Sorry I do not speak French very well.
It sounds like you are missing a reference to Microsoft DAO Object
Library
This can occur with Access 200 or Access 2002 as Microsoft has not
included a default reference to DAO.
To set the reference:

1) Open any code or Class module.
Menu-> Tools-References
Scroll down to "Microsoft DAO Object Library "
Select this entry

That should fix your problem.

:)


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

THe error is generated because the custom prop does not yet exist. The
error handler for that code then creates the property. So it should not
be an issue that the error is generated as long as you have not modified
the code at all by adding your own error handler etc.

Sub SetProperty(ByVal strPropName As String, ByVal varPropType As
Variant, _
ByVal varPropValue As Variant)
Const cProcedureName As String = "SetProperty"
On Error GoTo Err_Handler
Dim db As DAO.Database
Dim prp As DAO.Property

Set db = DBEngine(0)(0)
db.Properties(strPropName).Value = varPropValue

Exit_Sub:
On Error GoTo 0
Set prp = Nothing
Set db = Nothing
Exit Sub
Err_Handler:
Select Case Err
Case cerrPropertyNotFound
Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
db.Properties.Append prp
Case Else
'Call LogError(Err.Number, Err.Description, cModuleName &
cProcedureName)
End Select
Resume Exit_Sub

End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top