|
-
Feb 1st, 2000, 01:37 AM
#1
Thread Starter
Lively Member
When I run the following code it is telling me I have too few parameters and I don't know what else to try. The first sql statement (sql) does work but Sql3 has 'too few parameters'. What to do?
PS See I am trying to click on a find button which pulls info from multiple tables but I cannot get it to pull info from a second table into textboxes on my form. Please Help!
Private Sub cmdGoFind_Click()
Dim db As Database
Dim tb As Recordset
Dim tb11 As Recordset
Dim tb20 As Recordset
Dim sql As String
Dim Sql2 As String
Dim SQL3 As String
Set db = DBEngine.OpenDatabase("S:\Dbapps\Repo\RepoInv", False, False)
sql = ("Select * from RepoInventory where [Account Number] = " & "'" & txtFindAccount.Text & "'")
SQL3 = ("SELECT Auctions.* FROM Auctions, RepoInventory WHERE Auctions.AuctionID = RepoInventory.AuctionID")
Set tb = db.OpenRecordset(sql)
Set tb20 = db.OpenRecordset(SQL3)
-
Feb 1st, 2000, 01:52 AM
#2
Member
Try this:
sql3 = "Select * from Auctions a Inner Join RepoInventory r on a.AuctionID = r.AuctionID"
-
Feb 1st, 2000, 01:56 AM
#3
Hyperactive Member
So, in SQL3, you are trying to open 2 tables in one statement? I'm not sure if you can do that, do you have to do it this way?
-
Feb 1st, 2000, 03:05 AM
#4
Thread Starter
Lively Member
I tried Turins statement but it still says too few parameters?!@#! And to the last question I don't need to open 2 tables in one sql I just want to open them in some way so that I can fill in my textboxes with info that comes from the different tables.
-
Feb 1st, 2000, 05:02 AM
#5
Member
Are you getting the error on the line where you that reads (sql3 = "Select.....") or the line that reads (set tb20 = db.openrecordset...)?
-
Feb 1st, 2000, 06:12 AM
#6
Thread Starter
Lively Member
Hey good to see you checked back in. My error is on the line:
Set tb20 = db.OpenRecordset(SQL3)
Thanks for looking at it.
-
Feb 1st, 2000, 06:40 AM
#7
Lively Member
try alias .. i tried and it works..
select A.* from auth A, Repo B
where a.id=b.id
-
Feb 1st, 2000, 06:43 AM
#8
Thread Starter
Lively Member
Thanks I will try it first thing tomorrow morning.
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
|