Can anyone tell me if it is possible to build a relationship between 2 tables in VBA or do I always have to create a relationship in the dersigner ?
Printable View
Can anyone tell me if it is possible to build a relationship between 2 tables in VBA or do I always have to create a relationship in the dersigner ?
Assuming you are using Access. The easiest way is to set up your query in the Query design view and copy/paste the SQL from the View/SQL view menu.
The VBA code is something like :-
Code:Dim MySQL As String
MySQL = "UPDATE Employees " & _
"SET Employees.Title = 'Regional Sales Manager' " & _
"WHERE Employees.Title = 'Sales Manager';"
DoCmd.RunSQL MySQL