Using VBA, how do you determine the Primay key of a table? I'm working with TableDefs, but I can't locate primary key. Thanks in advance!!
Using VBA, how do you determine the Primay key of a table? I'm working with TableDefs, but I can't locate primary key. Thanks in advance!!
Bing: VBA finding primary key
Review http://bytes.com/topic/access/answer...-key-using-vba
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I found this:
CurrentDb.TableDefs("MyTable").Indexes("PrimaryKey ").Fields
This worked.
Nice. I just tested on a table with compound key. It returns all the PK fields as a semi-colon delimited string.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.