join two tables for OpenRecordSet (1 Viewer)

penfold1992

Registered User.
Local time
Today, 09:17
Joined
Nov 22, 2012
Messages
169
I would like to join my two tables in vba together so I can reference them in the same way,

ie.

Set rs = dbs.OpenRecordset(SQLstr)

Me.Summarystr = Nz(rs![Summary], Null)

so I want to be able to combine two tables together in the SQL string in order to have both information inside the same record set...

Code:
SQLstr = "SELECT * FROM [table1] " & _
        "FULL OUTER JOIN [table2] ON [table1].[sequence]=[table2].[sequence] " & _
        "WHERE [table1].[sequence]='" & _
         Me.seq.Value & "'"

I just tried this but it didnt seem to like it, anyone got any ideas?
 

penfold1992

Registered User.
Local time
Today, 09:17
Joined
Nov 22, 2012
Messages
169
I used INNER JOIN which appeared to work... it would help if i understood the differences between inner left right and outer join... i get confused between the two
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:17
Joined
Aug 30, 2003
Messages
36,118
Get that query into design view and then edit the join. The 3 descriptions you'll see equate to INNER, LEFT & RIGHT.
 

Users who are viewing this thread

Top Bottom