- Local time
- Today, 13:54
- Joined
- Sep 12, 2006
- Messages
- 16,072
Using VBA to manipulate tables/indexes etc [SOLVED!]
Here's One
I am trying to manipulate tables/fields/indexes/relationships all from outside a dbs - in order to be able to update backends.
So one last problem.
When you create a relationship, the table with the foreign key gets a hidden index appended with a attribute of "foreign" set to TRUE.
Now, if this is a single column field, DAO/VBA seems to create the hidden index automatically, and then use it in the relationship.
However, with a muti-field index, I am getting an error that the index doesn't exist.
Does anyone know the correct syntax to add these fields
What I have is this
called twice, once for each field
AND THEN
this is working fine for a single field index, but not for 2-field indexes. Any ideas?
[solved - i got the process slightly wrong]
Here's One
I am trying to manipulate tables/fields/indexes/relationships all from outside a dbs - in order to be able to update backends.
So one last problem.
When you create a relationship, the table with the foreign key gets a hidden index appended with a attribute of "foreign" set to TRUE.
Now, if this is a single column field, DAO/VBA seems to create the hidden index automatically, and then use it in the relationship.
However, with a muti-field index, I am getting an error that the index doesn't exist.
Does anyone know the correct syntax to add these fields
What I have is this
Code:
rel.Fields.Append rel.createfield(rrst!relationfield)
rel.Fields(rrst!relationfield).ForeignName = rrst!relationforeignfield
AND THEN
Code:
DB.Relations.Append rel
this is working fine for a single field index, but not for 2-field indexes. Any ideas?
[solved - i got the process slightly wrong]
Last edited: