AccessGuruCarl
Programmer
Dim p As Property
Dim db As DAO.Database
Set db = CurrentDb()
'set the required expiry date (defaults to 30 days from now)
On Error Resume Next
With db
'check to see if already defined
Set p = .Properties("myCompany")
If Err = 3270 Then
Set p = .CreateProperty()
p.Name = "myCompany"
p.Type = dbText
p.Value = 0
.Properties.Append p
Err.Clear
Else
p.Value = sCoName
End If
Error is:
Compile Error
Can't assign to read-only property.
I have used this method in the past with no problems...
Thanks...
AccessGuruCarl
Programmers helping programmers
you can't find a better site.
Dim db As DAO.Database
Set db = CurrentDb()
'set the required expiry date (defaults to 30 days from now)
On Error Resume Next
With db
'check to see if already defined
Set p = .Properties("myCompany")
If Err = 3270 Then
Set p = .CreateProperty()
p.Name = "myCompany"
p.Type = dbText
p.Value = 0
.Properties.Append p
Err.Clear
Else
p.Value = sCoName
End If
Error is:
Compile Error
Can't assign to read-only property.
I have used this method in the past with no problems...
Thanks...
AccessGuruCarl
Programmers helping programmers
you can't find a better site.