Results 1 to 8 of 8

Thread: Stuck on Combo, SQL part!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73

    Post

    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)



  2. #2
    Member
    Join Date
    Mar 1999
    Location
    Louisville, KY
    Posts
    48

    Post

    Try this:

    sql3 = "Select * from Auctions a Inner Join RepoInventory r on a.AuctionID = r.AuctionID"

  3. #3
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    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?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73

    Post

    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.

  5. #5
    Member
    Join Date
    Mar 1999
    Location
    Louisville, KY
    Posts
    48

    Post

    Are you getting the error on the line where you that reads (sql3 = "Select.....") or the line that reads (set tb20 = db.openrecordset...)?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73

    Post

    Hey good to see you checked back in. My error is on the line:

    Set tb20 = db.OpenRecordset(SQL3)

    Thanks for looking at it.

  7. #7
    Lively Member
    Join Date
    Jan 2000
    Posts
    65

    Post

    try alias .. i tried and it works..

    select A.* from auth A, Repo B
    where a.id=b.id

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73

    Post

    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
  •  



Click Here to Expand Forum to Full Width