Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no given value for required parameters

Status
Not open for further replies.

jerseyjo

Technical User
Jan 11, 2008
3
US
below is my code:

Sub MyFirstConnection()

Dim con1 As ADODB.Connection
Dim recSet1 As ADODB.Recordset
Dim strSQL As String
Dim strsearch As String

strsearch = "ACI"

strSQL = "SELECT CorpDesc FROM rollup" & _
" WHERE Company = " & " '" & strsearch & "'"

Set con1 = CurrentProject.Connection

Set recSet1 = New ADODB.Recordset
recSet1.Open strSQL, con1

Do Until recSet1.EOF
Debug.Print recSet1.Fields("CorpDesc"), recSet1.Fields("Completed")
recSet1.MoveNext
Loop
recSet1.Close
con1.Close
Set con1 = Nothing
Set recSet1 = Nothing
End Sub
 
so what is the issue ?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I assume that the thread title is the error message you're getting when running this code?

if so then try debug.print strSQL just after you set this string, and make sure you're passing the correct values.
Also check your database and ensure that your value you're searching for is present in the records you're searching.

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
the issue is I'm getting the "no given value for required parameters" error.

the strSQL is as follows "SELECT CorpDesc FROM rollup WHERE Company='ACI'"

that looks right to me. yes, "ACI" is within the company field.

NOTE: rollup is already a query, not a table. do you think that might cause the issue? If it did, I thought it would give me a syntax error, more than anything else.
 
okay. nevermind. figured it out.
i rechecked my query. thanks chris!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top