[AccessD] Error help with upgrade from A03 to A13
John R Bartow
jbartow at winhaven.net
Wed Nov 16 17:46:46 CST 2016
Thanks Jim
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim
Dettman
Sent: Wednesday, November 16, 2016 6:57 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Error help with upgrade from A03 to A13
Sample from the on-line help.
Jim.
' Set property name variable.
strName = "LastUserName"
' Set property value variable.
strValue = InputBox("Please enter your full name") If
SetCustomProperty(strName, dbText, strValue) <> True Then
' Error occurred trying to set property.
MsgBox "Error occurred trying to set property."
End If
Function SetCustomProperty(strPropName As String, intPropType _
As Integer, strPropValue As String) As Integer
Dim dbs As Database, cnt As Container
Dim doc As Document, prp As Property
Const conPropertyNotFound = 3270 ' Property not found error.
Set dbs = CurrentDb ' Define
Database object.
Set cnt = dbs.Containers!Databases ' Define Container object.
Set doc = cnt.Documents!UserDefined ' Define Document object.
On Error GoTo SetCustom_Err
doc.Properties.Refresh
' Set custom property name. If error occurs here it means
' property doesn't exist and needs to be created and appended
' to Properties collection of Document object.
Set prp = doc.Properties(strPropName)
prp = strPropValue ' Set custom
property value.
SetCustomProperty = True
SetCustom_Bye:
Exit Function
SetCustom_Err:
If Err = conPropertyNotFound Then
Set prp = doc.CreateProperty(strPropName, intPropType,
strPropValue)
doc.Properties.Append prp ' Append to
collection.
Resume Next
Else
' Unknown error.
SetCustomProperty = False
Resume SetCustom_Bye
End If
End Function
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
John R Bartow
Sent: Wednesday, November 16, 2016 02:45 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Error help with upgrade from A03 to A13
Importance: High
Yes, thanks, I cannot find where its created. I'm going to have to go back
into the old version to figure this out. VM time.
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Stuart McLachlan
Sent: Wednesday, November 16, 2016 1:18 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Error help with upgrade from A03 to A13
To create a custom property you need to do something like:
Set dbs = CurrentDb
Set prp = dbs.CreateProperty("CheckForLabelPrinter", dbBoolean, True)
dbs.Properties.Append prp
On 16 Nov 2016 at 1:10, John R Bartow wrote:
> That is creating a custom property so it exists as soon as it's made.
> But to further that idea, maybe the method of creating a custom
> property has changed (or needs to be more implicit in newer versions?)
>
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf
> Of Stuart McLachlan Sent: Wednesday, November 16, 2016 12:30 AM To:
> Access Developers discussion and problem solving Subject: Re:
> [AccessD] Error help with upgrade from A03 to A13
>
> Since you've converted the DB, are you sure the property still exists?
>
>
>
>
> On 15 Nov 2016 at 23:48, John R Bartow wrote:
>
> > Good WAG but that didn't do that trick.
> >
> > -----Original Message-----
> > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On
> > Behalf Of Stuart McLachlan Sent: Tuesday, November 15, 2016 7:51 PM
> > To: Access Developers discussion and problem solving Subject: Re:
> > [AccessD] Error help with upgrade from A03 to A13
> >
> > Just a WAG. Try Dim dbs As DAO.Database.
> >
> > Without the DAO, you can get strange error messages when trying to
> > access properties.
> >
> >
> >
> > On 15 Nov 2016 at 19:29, John R Bartow wrote:
> >
> > > Dim dbs As Database
> >
> >
> > --
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
More information about the AccessD
mailing list