Question saving database properties

Eagle1

New member
Local time
Today, 12:03
Joined
Apr 11, 2012
Messages
4
Am trying to save database properties from:
File->Database properties.

When I make a change and then try to save I get the error message shown.

I've unprotected the code in the database and still cannot save the new properties.

Any ideas.

Thanks,
Eagle1
 

Attachments

  • Database_properties.png
    Database_properties.png
    13.1 KB · Views: 113
  • ErrorMessage.png
    ErrorMessage.png
    6 KB · Views: 108
Here is a function I found on a different forum. It was written by Crystal -- she gets all the thanks...

Code:
        '~~~~~~~~~~~~~~~~~~~~~ SetDatabaseProperty
        Function SetDatabaseProperty( _
           pPropName As String _
           , pPropType As Long _
           , pValue) As Byte
         
           'written by Crystal
         
           'set up Error Handler
           On Error GoTo Proc_Err
            
           CurrentDb.Properties.Append CurrentDb.CreateProperty( _
              pPropName, pPropType, pValue, False)
           
        Proc_Exit:
           Exit Function
          
        Proc_Err:
           If Err.Number = 3367 Then
              CurrentDb.Properties(pPropName) = pValue
              Resume Proc_Exit
           End If
           
           MsgBox Err.Description, , _
                "ERROR " & Err.Number _
                & "   SetDatabaseProperty"
          
           'press F8 to step through code and debug
           'remove next line after debugged
           Stop:    Resume
          
           Resume Proc_Exit
        End Function

Additional info from other forum:
this code could try to set a value if the property already exists, and only create it if necessary.

then, to get a property that has been set:

Code:

myvariable = CurrentDb.Properties(sPropName)

to clear a text database property, set it to " " as it cannot hold a zero-length string -- then test for this. To clear numeric properties, I normally set them to -99 and test for < 0

You can also use TempVars (although they are not as stable or persistent)

using VBA to add or change a tempvar:
Code:

TempVars.Add "tvVariableName", valueOrVariablename

if the tempvar already has a value, it will be changed

you can retrieve the value like this:
Code:

TempVars!tvVariableName

-- as ControlSource... =[TempVars]![tvVariableName]
-- in query... [TempVars]![tvVariableName]
-- in code, you can also use TempVars("tvVariableName")


Warm Regards,
Crystal
Microsoft MVP, Access
Remote Programming and Training
http://msaccessgurus.com/
303-335-0727

free video tutorials (Access, Excel, Windows Phone, Windows 8)
http://www.youtube.com/LearnAccessByCrystal
, http://www.youtube.com/LearnByCrystal

Access Basics
http://www.accessmvp.com/strive4peace
free 100-page book that covers essentials in Access

*
have an awesome day
*
 
Thank you, but all I'm trying to do is save the properties of the database using the dialog box shown in the first attachment - for example, the comment. I'm not trying to add additional properties. I am the creator and only administrator of this database and have opened it in exclusive mode. Further, at times in the past I have been able to save these properties, but lately have begun to get the error message shown in the second attachment.
Eagle1
 

Users who are viewing this thread

Back
Top Bottom