Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2008, 12:56 PM
Authorized User
 
Join Date: Mar 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default please help with debug error

I am getting an error "Too Few Parameters expected 1"
on all 3 of my .openrecordset 's. What am I missing? thx here's the code

Private Sub CalcSplit_Click()
Screen.MousePointer = 11

Dim dbsSBOA8000 As DAO.Database

Dim rstTotForfeit As DAO.Recordset
Set dbsSBOA8000 = CurrentDb
Set rstTotForfeit = dbsSBOA8000.OpenRecordset("GrandSumVBAForfeit")


Dim rstCalcContrib As DAO.Recordset
Set rstCalcContrib = dbsSBOA8000.OpenRecordset("TransCalcContrib-Final")

Dim rsttotalpoints As DAO.Recordset
Set rsttotalpoints = dbsSBOA8000.OpenRecordset("TotalSharesbyYear-query")

Dim TotContrib As Double
Dim tmpForefeitShare As Double
Dim CalcForefeit As Currency
Dim CalcContrib As Currency


Dim fldTotMult As DAO.Field
Set fldTotMult = rsttotalpoints![Multiplier]

Dim fldTotLost As DAO.Field
Set fldTotLost = rstTotForfeit![Forefeitures]


Dim fldMemberID As DAO.Field
Set fldMemberID = rstCalcContrib![Member Id]

Dim fldContrib As DAO.Field
Set fldContrib = rstCalcContrib![Contributions]

Dim fldForefeit As DAO.Field
Set fldForefeit = rstCalcContrib![Forefeitures]

Dim fldMultiplier As DAO.Field
Set fldMultiplier = rstCalcContrib![Multiplier]


rsttotalpoints.MoveFirst
rstTotForfeit.MoveFirst
rstCalcContrib.MoveFirst

tmpForefeitShare = (fldTotLost * -1) / fldTotMult
TotContrib = Forms![End of Year Pension Worksheet]![Contributions-Amt] / fldTotMult

Do Until rstCalcContrib.EOF

     CalcForefeit = fldMultiplier * tmpForefeitShare
     CalcContrib = fldMultiplier * TotContrib

     rsttrans.Edit
     rsttrans![Contributions] = CalcContrib
     rsttrans![Forefeitures] = CalcForefeit
     rsttrans.Update
     rstCalcContrib.MoveNext
Loop

Screen.MousePointer = 0
rstCalcContrib.Close
rsttotalpoints.Close
rstTotForfeit.Close
Set rstCalcContrib = Nothing
Set rsttotalpoints = Nothing
Set rstTotForfeit = Nothing
Set db = Nothing
MsgBox ("Finished Processing")
End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Debug arholly Access VBA 19 December 18th, 2006 01:52 PM
Error while trying to debug nileshr ASP.NET 1.0 and 1.1 Basics 2 September 13th, 2004 03:31 PM
Can't debug sithlrd General .NET 9 July 28th, 2004 05:00 PM
Error when trying to run site in debug mode Jgn BOOK: ASP.NET Website Programming Problem-Design-Solution 4 March 22nd, 2004 09:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.