Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Modules daovba ado > Error 'Too few ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1495 of 1609
Post > Topic >>

Error 'Too few parameters. Expected 1.'

by =?Utf-8?B?SnVsaWEgQg==?= <JuliaB@[EMAIL PROTECTED] > Jun 12, 2008 at 12:58 AM

Hi, excuse the cross posting. I did post this in Forms Coding, but didn't
get 
a response so I think I may have posted in the wrong place (seeing as my 
error occurs when using ADO). My apologies, I wouldn't normally post
twice! 
Anyway I've got a strange problem.

I've got a form 'EditPartNumbers' where a user can filter the records by 
selecting a value in a combo box, which in turn populates a value in a
hidden 
text box, 'txtFindHidden'. The form is then supposed to change it's 
datasource to a query 'PartNumbersFine_EditForm', which has a parameter in

it's RecordID field which is [Forms]![EditPartNumber]![txtFindHidden].

If I select a record from the combo box and run the query directly from 
Access it works fine, but if I try and run it through the following code,
I 
get an error:

'Run-time error -2147217904 (80040e10): Too few parameters. Expected 1.'

Here's the code:

 Dim db As ADODB.Connection
    Dim rs As New ADODB.Recordset
    Set db = CurrentProject.Connection
    
    'firstly get a recordset to check if there are any records
    If formMode = "New" Then
        rs.Open "PartNumbersNew_EditForm", db, adOpenKeyset, 
adLockOptimistic, adCmdTableDirect
    Else
        'if the form isn't showing just new parts then get the recordset 
depending on whether it's a find part or not
        If findPart = "" Then
            rs.Open "PartNumbersAll_EditForm", db, adOpenKeyset, 
adLockOptimistic, adCmdTableDirect
        Else
'this is where it stalls!            
rs.Open "PartNumbersFind_EditForm", db, adOpenKeyset, adLockOptimistic, 
adCmdTableDirect
        End If
    End If

I've searched and it would seem that the most common problem is a syntax 
one, but I can't understand that it in this case.

Any ideas?

Thanks
Julia
 




 2 Posts in Topic:
Error 'Too few parameters. Expected 1.'
=?Utf-8?B?SnVsaWEgQg==?=   2008-06-12 00:58:01 
Re: Error 'Too few parameters. Expected 1.'
"Alex Dybenko"   2008-06-13 09:44:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 10:16:31 CST 2008.