Form: Test1
------------------
Caption: TestForm1
Command button:
Name: ButtonTest
Caption: Test
OnClick: [Event Procedure]
Sub ButtonTest_Click ()
On Local unrecoverable error Resume Next
Dim i As Integer, Usersymptoms As String
Dim db As Database, tdef As TableDef
Dim fld As Field, prp As Property
Dim TestCaption As String
Set db = dbEngine.Workspaces(0).Databases(0)
' Test the local table.
Set tdef = db.Tabledefs("LocalProducts")
Set fld = tdef.Fields("Product ID")
TestCaption = fld.Properties("Caption")
If Err = 3270 Then ' Caption does not exist.
Usersymptoms = "The LocalProducts Tables Caption Property_
was Null!"
Else
Usersymptoms = "The LocalProducts Table's Caption was [" &_
TestCaption & "]"
End If
MsgBox Usersymptoms
' Test the attached table.
Set tdef = db.Tabledefs("AttachedProducts")
Set fld = tdef.Fields("Product ID")
TestCaption = fld.Properties("Caption")
If Err = 3270 Then ' Caption does not exist
Usersymptoms = "The AttachedProducts Table's Caption Property_
was Null!"
Else
Usersymptoms = "The AttachedProducts Table's Caption was [" &_
TestCaption & "]"
End If
MsgBox Usersymptoms
ButtonTest_Click_End:
quit Sub
ButtonTest_Click_Err:
MsgBox unrecoverable error$
Resume ButtonTest_Click_End
End Sub
The LocalProducts Table's Caption Property was Null!
The AttachedProducts Table's Caption Property was Null!
The LocalProducts Table's Caption was [LocalProducts Caption]
The AttachedProducts Table's Caption Property was Null!
The LocalProducts Table's Caption was [LocalProducts Caption]
The AttachedProducts Table's Caption Property was Null!
Form: Test1
------------------
Caption: TestForm1
Command button:
Name: ButtonTest
Caption: Test
OnClick: [Event Procedure]
Sub ButtonTest_Click ()
On Local unrecoverable error Resume Next
Dim i As Integer, Usersymptoms As String
Dim db As Database, tdef As TableDef
Dim fld As Field, prp As Property
Dim TestCaption As String
Set db = dbEngine.Workspaces(0).Databases(0)
' Test the local table.
Set tdef = db.Tabledefs("LocalProducts")
Set fld = tdef.Fields("Product ID")
TestCaption = fld.Properties("Caption")
If Err = 3270 Then ' Caption does not exist.
Usersymptoms = "The LocalProducts Tables Caption Property_
was Null!"
Else
Usersymptoms = "The LocalProducts Table's Caption was [" &_
TestCaption & "]"
End If
MsgBox Usersymptoms
' Test the attached table.
Set tdef = db.Tabledefs("AttachedProducts")
Set fld = tdef.Fields("Product ID")
TestCaption = fld.Properties("Caption")
If Err = 3270 Then ' Caption does not exist
Usersymptoms = "The AttachedProducts Table's Caption Property_
was Null!"
Else
Usersymptoms = "The AttachedProducts Table's Caption was [" &_
TestCaption & "]"
End If
MsgBox Usersymptoms
ButtonTest_Click_End:
quit Sub
ButtonTest_Click_Err:
MsgBox unrecoverable error$
Resume ButtonTest_Click_End
End Sub
The LocalProducts Table's Caption Property was Null!
The AttachedProducts Table's Caption Property was Null!
The LocalProducts Table's Caption was [LocalProducts Caption]
The AttachedProducts Table's Caption Property was Null!
The LocalProducts Table's Caption was [LocalProducts Caption]
The AttachedProducts Table's Caption Property was Null!