Results 1 to 2 of 2

Thread: Build relationship with VBA

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Build relationship with VBA

    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 ?

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    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
    Regards
    BrianB
    -------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width