1

I'm getting an error 3061, too few parameters on this:

Dim PrbApps1 As Recordset

Set PrbApps1 = CurrentDb.OpenRecordset("Select * FROM [Application] WHERE [PYR_TenderRef] =" & TenderID.Value)

where TenderID is a textbox

I'm new to this, but I've check everything I can think of. Probably simple error but any help would be greatly appreciated.

1 Answer 1

1

You need double quotes on the other side of your textbox value. But if it's in an access form it should be referenced with Me.

Set PrbApps1 = CurrentDb.OpenRecordset("Select * FROM [Application] WHERE [PYR_TenderRef] = '" & Me!TenderID.Value & "'")
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, it actually needed ' as well = '" & Me.TenderID.Value & "'") why I don't know.
FYI, use me! instead me. me. references the textbox as a property of the me object. me! creates the textbox as an object, which execute a little faster when you have a lot of references. (Though intellisense doesn't work with it sadly)
I had no idea, I thought it was just preference. Thanks @Elias
Here goes some explanations: msdn.microsoft.com/en-us/library/office/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.