Error 3061 : Too few parameters. Expected 2 .. Tried everything.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShashankCharati
    New Member
    • Mar 2014
    • 1

    #1

    Error 3061 : Too few parameters. Expected 2 .. Tried everything.

    Code:
    Private Sub lstglo_Click()
    txtglo.Value = lstglo.Value
    Dim rs As DAO.Recordset
    Dim str As String
    txtglo.SetFocus
    str = "Select glosssary.meaning,glossary.description, glossary.specification, glossary.hyperlink from Glossary where word = '" & txtglo.Text & "';"
    [B][I]Set rs = CurrentDb.OpenRecordset("Select glosssary.meaning,glossary.description, glossary.specification, glossary.hyperlink from Glossary where word = '" & txtglo.Text & "';")[/I][/B]
    lblglomean.Caption = rs.Fields("Meaning").Value
    lblglodesc.Caption = rs.Fields("Description").Value
    lblglospec.Caption = rs.Fields("Specification").Value
    lblglohyp.Caption = rs.Fields("Hyperlink").Value
    End Sub
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    ShashankCharati ,
    Welcome to Bytes. You'll find lots of good help here.

    I think your understanding of trying everything is suspect. Here's something very simple you can try, in order to find the problem yourself. Type, or paste, your query into the query editor's SQL view. You can copy this string:

    Select glosssary.meani ng,glossary.des cription, glossary.specif ication, glossary.hyperl ink from Glossary where word = 'xyz';

    You can open the query editor and find the SQL view by right-clicking in the top half, or in the drop-down view option. Paste the query, go to datasheet view. You should get a fuller explanation of what fields are causing the error.

    Jim
    Last edited by jimatqsi; Mar 14 '14, 12:02 PM. Reason: correct typo

    Comment

    Working...