Error 3270 Property not found

  • Thread starter Thread starter Nelson
  • Start date Start date
N

Nelson

I am getting an Error 3270 Property not found on this line of Lebans
MonthCalendar (http://www.lebans.com/monthcalendar.htm) in Access 2000:

strPropValue = db.Properties(strPropName)
This line can be found in the clsMonthCal ClassModule

The MonthCalendar routines were working fine until I tried changing the
Access title bar with the code listed in:
1) VB help for AppTitle properties example
2) Microsoft Knowledge Base Article - 210169
3) Microsoft Knowledge Base Article - 210591 (this one works)

How do I fix this? How did the problem occur?
TIA
 
The change to the title of the Access WIndow would not have any effect
on the MonthCalendar code.

It looks like an error handling issue. My original code contains an
error handler to catch when you try to set a Props value that does not
exist. The error handler simply creates the prop. THe MS KB article you
quoted follows the exact same procedure. YOu have probably simply copied
and pasted the error handler and not adjusted the declaration that
states which error handler to use for the SetProperty function.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thanks for the reply Stephen. I removed the appstitle code but the problem
persists. It doesn't look to me that the GetProperty Function in
clsMonthCal module has error handling that creates the prop. I tried to add
it but I don't yet know how to formulate it.

BTW: the MonthCalendar routine is a very nice bit of work...thanks for
creating it and making it available.
 
Sorry I thought you said it was the SetProperty call.

The error handling in the GetProperty call simply catches any occurance
whereby a Property you are trying to access does not exist.
It sounds like you have modified the error handler. Post your code for
the GetProperty method here.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
After the error occured, I tried changing the GetProperty method. When it
didn't work, I commented it out:

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

Const cProcedureName As String = "GetProperty"
Dim db As DAO.Database
'Dim prp As DAO.Property
'Const conPropNotFoundError = 3270

Set db = CurrentDb
strPropValue = db.Properties(strPropName)
GetProperty = True

Exit_Sub:
On Error GoTo 0
Set db = Nothing
Exit Function
Err_Handler:
GetProperty = False
Select Case Err
' Case conPropNotFoundError
' Set prp = db.CreateProperty(strPropName, dbVarBinary)
' db.Properties.Append prp
' db.Properties.Refresh
' Resume Exit_Sub
Case cerrPropertyNotFound
Case Else
' Call LogError(Err.Number, Err.Description, cModuleName &
cProcedureName)
End Select
Resume Exit_Sub
End Function
 
Nelson there is no need for you to change my GetProperty method in any
form whatsoever. Did you try getting/setting the AppTitle property via
my existing GetProperty/SetProperty methods?

I would advise you to restore the GetProperty and SetProperty methods
back to their original versions.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I removed the commented out additions I made and for good measure replaced
clsMonthCal with the one from your website (after checking the versions are
the same) but both actions did not help. I also deleted all the apptitle
code and all code referencing it. However, the problem of error 3270 still
occurs at strPropValue = db.Properties(strPropName) in the GetProperty
function of the clsMonthCal module. (The problem is only occuring on my
computer, not on any of the other 10 computers running the same code.)
 
Do you have a Reference set to DAO above/instead of ADO?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Ok, I have figured out what I did wrong. I set the break on all errors
option in VB. And the computer dutifuly did what I asked it to do!
Changing it to break on all unhandled errors fixed the problem! Stephen,
thanks for responding.

Nelson
 
Glad you figured it out Nelson. Honestly, I would never have thought of
that solution to this issue. I'll have to add it to to the Hint/Tips
section of the monthCalendar page.
:-)


--

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