Mark_Thornton
New member
- Local time
- Today, 22:49
- Joined
- Oct 31, 2011
- Messages
- 4
Hello everybody! My name is Mark, I'm new here, and I am hoping that someone can help me with this VBA problem...
I am working in Access 2003 and need some VBA code to identify tables that are both hidden and linked, in another Access 2003 database. My code loops through all the tables and tests each one for the attributes of being linked and hidden, using the following 2 functions:
Function IsTableHidden(objTable As TableDef) As Boolean
IsTableHidden = (objTable.Attributes And dbHiddenObject)
End Function
Function IsLinkedTable(objTable As TableDef) As Boolean
IsLinkedTable = (objTable.Attributes And dbAttachedTable)
End Function
The function IsLinkedTable worked fine, but IsHiddenTable did not. Further investigation revealed that, for a table that is both linked and hidden, objTable.Attributes.Value = dbAttachedTable.
I was expecting that objTable.Attributes.Value = dbAttachedTable + dbHiddenObject, but this seems to be untrue. Is my expectation wrong, or have I discovered a bug in Access 2003?
As dbHiddenObject does not seem to be recorded in the Attributes, I feel thoroughly stuck: how else can I discover if a given table is hidden, or not?
All help and advice will be extremely welcome. Thanks in advance to anyone who contributes to this thread.
Best wishes
Mark
I am working in Access 2003 and need some VBA code to identify tables that are both hidden and linked, in another Access 2003 database. My code loops through all the tables and tests each one for the attributes of being linked and hidden, using the following 2 functions:
Function IsTableHidden(objTable As TableDef) As Boolean
IsTableHidden = (objTable.Attributes And dbHiddenObject)
End Function
Function IsLinkedTable(objTable As TableDef) As Boolean
IsLinkedTable = (objTable.Attributes And dbAttachedTable)
End Function
The function IsLinkedTable worked fine, but IsHiddenTable did not. Further investigation revealed that, for a table that is both linked and hidden, objTable.Attributes.Value = dbAttachedTable.
I was expecting that objTable.Attributes.Value = dbAttachedTable + dbHiddenObject, but this seems to be untrue. Is my expectation wrong, or have I discovered a bug in Access 2003?
As dbHiddenObject does not seem to be recorded in the Attributes, I feel thoroughly stuck: how else can I discover if a given table is hidden, or not?
All help and advice will be extremely welcome. Thanks in advance to anyone who contributes to this thread.
Best wishes
Mark