Hi friends,
Ive facing this problem when I started to use this function, which the source module I found from the internet.
Once I run the module, I've received this message " Runtime Error 3270 Property not found"
Sub ExpiryDate1()
'creates or resets a property called ExpiryDate
'to use it type ExpiryDate in the debug window
'to remove the property type the following in the debug window
' DBEngine(0)(0).Properties.Delete "ExpiryDate"
On Error Resume Next
Dim db As Database
Dim p As Property
Dim pval As Date
Set db = DBEngine(0)(0)
'get the required expiry date (defaults to 30 days from now)
'NOTE: if an invalid date is entered it will generate 00:00:00
pval = CDate(InputBox("Enter the back up Date", "Set back up Date", Now() + 60))
With db
'check to see if already defined
Set p = .Properties("ExpiryDate")
If Err = 3270 Then 'property does not exist
Set p = .CreateProperty()
p.Name = "ExpiryDate"
p.Type = dbDate
p.Value = pval
.Properties.Append p
Debug.Print "Expiry Date is : "; p.Value
GoTo exit_setexpirydate
Else
Debug.Print "Expiry Date was : "; p.Value
p = pval
Debug.Print "Expiry Date is now : "; p.Value
End If
End With
exit_setexpirydate:
Set p = Nothing
Set db = Nothing
End Sub
I got message runtime error on the red mark
Please help me to solve this problem.
Best regards.
Ive facing this problem when I started to use this function, which the source module I found from the internet.
Once I run the module, I've received this message " Runtime Error 3270 Property not found"
Sub ExpiryDate1()
'creates or resets a property called ExpiryDate
'to use it type ExpiryDate in the debug window
'to remove the property type the following in the debug window
' DBEngine(0)(0).Properties.Delete "ExpiryDate"
On Error Resume Next
Dim db As Database
Dim p As Property
Dim pval As Date
Set db = DBEngine(0)(0)
'get the required expiry date (defaults to 30 days from now)
'NOTE: if an invalid date is entered it will generate 00:00:00
pval = CDate(InputBox("Enter the back up Date", "Set back up Date", Now() + 60))
With db
'check to see if already defined
Set p = .Properties("ExpiryDate")
If Err = 3270 Then 'property does not exist
Set p = .CreateProperty()
p.Name = "ExpiryDate"
p.Type = dbDate
p.Value = pval
.Properties.Append p
Debug.Print "Expiry Date is : "; p.Value
GoTo exit_setexpirydate
Else
Debug.Print "Expiry Date was : "; p.Value
p = pval
Debug.Print "Expiry Date is now : "; p.Value
End If
End With
exit_setexpirydate:
Set p = Nothing
Set db = Nothing
End Sub
I got message runtime error on the red mark
Please help me to solve this problem.
Best regards.