B
Bill (Unique as my name)
Is is possible to establish table relationships in VBA?
Thanks in advance.
Thanks in advance.
Outreach in Grand Junction, Colorado as a volunteer. The informationFrom 1997 to 2000, I managed the computer systems for the Catholic
snipAllen said:You can programmatically created relationships iwth CreateRelation().
Thie example creates a relationship between tblConContractor and tblBooking,
so one contractor can have multiple bookings, with cascading updates and
deletes. Use any name for the relation itself.
The only odd-looking bit is CreateField(). This is not creating fields in
the table; just in the relation.
Sub CreateRelationDAO()
Dim db As DAO.Database
Dim rel As DAO.Relation
Dim fld As DAO.Field
snipSteve said:Bill,
Sorry to hear about your life.
But as regards your database(s), there's probably a simpler approach. I
assume these troublesome tables are not the only tables in the database?
If the purpose is to completely replace the 4 tables in the second
database with the 4 tables being imported from the first database
(that's what I have understood), then I would be inclined to focus on
replacing the data rather than the tables themselves. After bringing
the 4 tables over to the other PC via the USB drive, this would then
involve running code in the second database something like this...