[AccessD] Error help with upgrade from A03 to A13

Jim Dettman jimdettman at verizon.net
Wed Nov 16 06:58:52 CST 2016


Also this, which might make the app a bit more bullet proof depending on
what your using those properties for.

Jim.

Private Sub Form_Open(Cancel As Integer)
	Dim strTitle As String, strSubject As String, strAuthor As String

	strTitle = "Title"
	strSubject = "Subject"
	strAuthor = "Author"

	Me!txtTitle = GetSummaryInfo(strTitle)
	Me!txtSubject = GetSummaryInfo(strSubject)
	Me!txtAuthor = GetSummaryInfo(strAuthor)
End Sub

Function GetSummaryInfo(strPropName As String) As String
	Dim dbs As Database, cnt As Container
	Dim doc As Document, prp As Property

	' Property not found error.

Const conPropertyNotFound = 3270
	On Error GoTo GetSummary_Err
	Set dbs = CurrentDb
	Set cnt = dbs.Containers!Databases
	Set doc = cnt.Documents!SummaryInfo
	doc.Properties.Refresh
	GetSummaryInfo = doc.Properties(strPropName)

GetSummary_Bye:
	Exit Function

GetSummary_Err:
	If Err = conPropertyNotFound Then
		Set prp = doc.CreateProperty(strPropName, dbText, "None")
		' Append to collection.
		doc.Properties.Append prp
		Resume
	Else

' Unknown error.
		GetSummaryInfo = ""
		Resume GetSummary_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



More information about the AccessD mailing list