Error 3061 Too Few Parameters Expected 3
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Access Too Few Parameters Expected 3
this site About Us Learn more about Stack Overflow the company Business Learn sql too few parameters expected 3 more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question error 3061 too few parameters expected 2 x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up
Access Run Time Error 3061 Too Few Parameters Expected 1
Run-time Error '3061' Too few parameters. Expected 3 up vote 0 down vote favorite I know this has been asked before, but the questions I have looked at are all a bit different. I am working on creating a temporary table, importing data, placing the data in an existing table, and deleting the temp table. Here is my code: Dim db As Database
Ms Access Run Time Error 3061 Too Few Parameters
Dim StrSql As String Dim rst As Recordset Set db = CurrentDb() If DCount("[Name]", "MSysObjects", "[Name] = 'tblInfoLink'") = 1 Then DoCmd.DeleteObject acTable, "tblInfoLink" StrSql = "SELECT tblStaff.LastName, tblStaff.FirstName, tblStaff.Rank, tblStaff.PriPhone, " _ & " tblStaff.SecPhone, tblStaff.HireDate INTO tblInfoLink " _ & " FROM [\\Server\BE.accdb].tblStaff " _ & " WHERE (((tblInfo.LastName)=[tblInfo].[LastName]) AND ((tblInfo.FirstName)=[tblInfo].[FirstName]) AND ((tblInfo.HireDate)=[tblInfo].[HireDate]));" db.Execute StrSql ElseIf DCount("[Name]", "MSysObjects", "[Name] = 'tblInfoLink'") = 0 Then StrSql = "SELECT tblStaff.LastName, tblStaff.FirstName, tblStaff.Rank, tblStaff.PriPhone, " _ & " tblStaff.SecPhone, tblStaff.HireDate INTO tblInfoLink " _ & " FROM [\\Server\BE.accdb].tblStaff " _ & " WHERE (((tblStaff.LastName)=[tblInfo].[LastName]) AND " _ & " ((tblStaff.FirstName)=[tblInfo].[FirstName]) AND ((tblStaff.HireDate)=[tblInfo].[HireDate]));" db.Execute StrSql End If StrSql = "Update tblInfo Set PriPhone = Null, SecPhone = Null" db.Execute StrSql StrSql = "INSERT Into tblInfo (PriPhone, SecPhone) " _ & " SELECT tblInfoLink.PriPhone, tblInfoLink.SecPhone " _ & " FROM tblInfoLink " _ & " WHERE (((tblInfoLink.LastName)=[tblInfo].[LastName]) AND " _ & " ((tblInfoLink.FirstName)=[tblInfo].[FirstName]) AND ((tblInfoLink.HireDate)=[tblInfo].[HireDate]));" db.Execute StrSql 'Delete Linked Tables DoCmd.DeleteObject acTable, "tblInfoLink" As soon as I try and run this, I get the Run-time Error '3061' Too few parameters. Expected 3. When I hit debug the highligthed area is: db.Execute
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us run time error 3061 too few parameters expected 2 Learn more about Stack Overflow the company Business Learn more about hiring developers
Run Time Error 3061 Too Few Parameters Expected 1
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack run time error 3061 too few parameters expected 3 Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why Run-time error '3061'. Too few parameters. http://stackoverflow.com/questions/31128093/run-time-error-3061-too-few-parameters-expected-3 Expected 1? Access 2010 up vote 1 down vote favorite I have researched all the STACKOVERFLOW questions on this but cannot make it work. I have a simple table: And a form: I want to extract the fields from the table T:ActityRoster and the “Activity Date” from the form and “add” them to a table T:ActivityHistory. A STACKOVERFLOW expert helped me with some code, but it won’t http://stackoverflow.com/questions/29777371/why-run-time-error-3061-too-few-parameters-expected-1-access-2010 even set the first recordset:rsIn Dim ActID As Integer, actDate As Date, val1 As Long, val2 As Long, val3 As Boolean, val4 As Currency Dim db As Database, rsIn As Recordset, rsOut As Recordset Dim strSQL As String Set db = CurrentDb ActID = Me.cboActivityName.Column(0) strSQL = "SELECT * FROM T:ActivityRoster WHERE [ActivityID] = ActID" Debug.Print strSQL Set rsIn = db.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly) rsIn.MoveLast Set rsOut = db.OpenRecordset("T:AttendanceHistory", dbOpenDynaset, dbEditAdd) rsOut.MoveLast actDate = Me.ActivityDate.Value ' retrive the date from the form With rsIn .MoveFirst Do val1 = !ActivityID val2 = !MemberID val3 = !Attended val4 = !AmtSpent With rsOut .AddNew !ActivityDate = actDate !ActivityID = val1 !MemberID = val2 !Attended = val3 !AmtSpent = val4 .Update End With .MoveNext Loop Until .EOF .Close End With rsOut.Close Set rsIn = Nothing Set rsOut = Nothing Set db = Nothing End Sub I have verified that all field names are correct and are consistent data types. When I put the query back into Access, it gives what is expected. ms-access access-vba ms-access-2010 share|improve this question edited Apr 21 '15 at 17:18 HansUp 79.1k114371 asked Apr 21 '15 at 15:58 Michael 4619 add a comment| 2 Answers 2 active oldest votes
Unanswered Topics Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA Runtime Error 3061 - too few parameters User Name Remember Me? Password Reminder Password Register Register | FAQ | Members http://p2p.wrox.com/access-vba/30926-runtime-error-3061-too-few-parameters.html List | Calendar | Today's Posts | Search Access VBA Discuss using VBA for Access programming. Search Forums Show Threads Show Posts Advanced Search Find All Thanked Posts Go to Page... Welcome to the p2p.wrox.com Forums. You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and too few readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free . Page 1 of 2 1 2 > Thread Tools Display Modes #1 (permalink) June 28th, 2005, 08:24 AM Raymie_C Authorized User Join Date: Apr too few parameters 2005 Location: , , . Posts: 10 Thanks: 0 Thanked 0 Times in 0 Posts Runtime Error 3061 - too few parameters I am hoping someone could help. I have a database which users will access to update the status and forecast of business objectives and sub-objectives on a monthly basis. The users will open the form which presents a parameter form based on a parameter query. The users will select the reporting month from a combobox which opens the reporting form (grouped by objective with the sub-objectives listed in a subdatasheet form for that specific month). This works perfectly by restricting the sub-objectives by the month. The users will then update the status and forecast of these sub-objectives. The problem arises when I go to export the status and forecasts of that specified month to a PowerPoint presentation (for reporting at our monthly management meetings) I am presented with "Error 3061 : Too few parameters.Expected 1". Sometimes this number is 2. and breaks on the line below. Set recStatus = dbStatus.OpenRecordset(strSQL, dbOpenDynaset) strSQL contains the code: strSQL = "SELECT * FROM qryEnablerLookup WHERE [fkMonthID]" & " = '" & Forms!frmCriteria!cboMonth & "';" I am at a total loss. When I go to debugging, the value being passed is correct