|
-
Apr 13th, 2000, 01:10 AM
#1
Thread Starter
Hyperactive Member
Hi Everyone!
Could someone help me out with learning this?
I am using DAO. I'm using this code to open a database and select a table to work with:
Set db = OpenDatabase ("C:\db2")
' open up the dynaset
Set rs = db.OpenRecordset("TableName1", dbOpenDynaset)
This works great. Now I want to open two tables just like when using recordsource with datacontrol:
strSQL = "Select * from _ TableName1,TableName2 _
where TableName1.Id_num = Table2.Id_num"
Set db = OpenDatabase ("C:\db2")
' open up the dynaset
Set rs = db.OpenRecordset strSQL, dbOpenDynaset)
This doesn't work great 
Any Code or Help is really appreciated!
Thanks Again,
Joey O
-
Apr 13th, 2000, 01:16 AM
#2
Change your select statement to this:
Select * from TableName1 Inner Join TableName2 On _
TableName1.Id_num = Table2.Id_num
Also, you have to be sure that those 2 tables related, I mean that they have common Id_num values.
[Edited by Serge on 04-13-2000 at 11:18 AM]
-
Apr 13th, 2000, 01:26 AM
#3
Thread Starter
Hyperactive Member
That was fast! Thanks Surge, I'm so glad you could help me. Someday I hope I can help you too!
Joey O
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|