doco
Power User
- Local time
- Yesterday, 20:24
- Joined
- Feb 14, 2007
- Messages
- 482
I need to dynamically drop and create a foreign key restraint against a linked table. When attempting this I get
Yet I can easily create the same relationship on that linked table using the wizard.
Is there a way to drop and create relationships against linked tables using VBA/SQL?
This creates the error:
TIA
run-time error #'3613'
Cannot create a relationship on linked ODBC tables.
Yet I can easily create the same relationship on that linked table using the wizard.
Is there a way to drop and create relationships against linked tables using VBA/SQL?
This creates the error:
Code:
sqlCreateRelKey = "ALTER TABLE item_depreciation_input "
sqlCreateRelKey = sqlCreateRelKey & "ADD CONSTRAINT rel_code_sched "
sqlCreateRelKey = sqlCreateRelKey & "FOREIGN KEY ([pprop_category_cd]) REFERENCES code_table ([id]) "
DoCmd.RunSQL sqlCreateRelKey
TIA