Reading Version information from properties

  • Thread starter Thread starter Gerald
  • Start date Start date
G

Gerald

Is there a way to put the version information within a text field on a form
so that I only have to enter once in properties and have it show in all the
areas I am needing it listed?

Gerald
 
There is always a way, but I am a little unsure of what you want to
do.

What version number are you talking about. If it is the database
window, then you can use the Properties collection of the Database
object to save custom properties (in your case, one named Version).
The following code is from the CreateProperty method:


Sub CreatePropertyX()

Dim dbsNorthwind As Database
Dim prpLoop As Property

Set dbsNorthwind = OpenDatabase("Northwind.mdb")

' Set the Archive property to True.
SetProperty dbsNorthwind, "Archive", True

With dbsNorthwind
Debug.Print "Properties of " & .Name

' Enumerate Properties collection of the Northwind
' database.
For Each prpLoop In .Properties
If prpLoop <> "" Then Debug.Print " " & _
prpLoop.Name & " = " & prpLoop
Next prpLoop

' Delete the new property since this is a
' demonstration.
.Properties.Delete "Archive"

.Close
End With

End Sub

Sub SetProperty(dbsTemp As Database, strName As String, _
booTemp As Boolean)

Dim prpNew As Property
Dim errLoop As Error

' Attempt to set the specified property.
On Error GoTo Err_Property
dbsTemp.Properties("strName") = booTemp
On Error GoTo 0

Exit Sub

Err_Property:

' Error 3270 means that the property was not found.
If DBEngine.Errors(0).Number = 3270 Then
' Create property, set its value, and append it to the
' Properties collection.
Set prpNew = dbsTemp.CreateProperty(strName, _
dbBoolean, booTemp)
dbsTemp.Properties.Append prpNew
Resume Next
Else
' If different error has occurred, display message.
For Each errLoop In DBEngine.Errors
MsgBox "Error number: " & errLoop.Number & vbCr & _
errLoop.Description
Next errLoop
End
End If

End Sub



Chris Nebinger
 
Sorry Yes I am refereing to a manual field I typed in the Database
properties that is my version control numbere as it stand curretnly I ahve
it spread a few forms and reports.

I am trying to see if there is a way to call to the database properties
where the information I typed is and update the individual loactions with
the information showing within the database properties. This woudl save me
a lot of time and would make it to where all I ahve to do is update one area
and know that all other areas are updated to new version number.
 
Back
Top