iankerry
Registered User.
- Local time
- Today, 19:10
- Joined
- Aug 10, 2005
- Messages
- 190
Hi all,
I have taken over some code and am struggling with a part of it. The code below works fine and does what it needs to do. I have added a couple of new fields to it, and that was fine too.
However, I have reached the point where i can't add anymore fields as I get "too many arguments".
So is there a maximum number and if so is there a way around it?
I use this routine to create emails with information in from the database, and I need to add more info.
The error comes on the Public Function DoRemote Line.
Thanks
I have taken over some code and am struggling with a part of it. The code below works fine and does what it needs to do. I have added a couple of new fields to it, and that was fine too.
However, I have reached the point where i can't add anymore fields as I get "too many arguments".
So is there a maximum number and if so is there a way around it?
I use this routine to create emails with information in from the database, and I need to add more info.
The error comes on the Public Function DoRemote Line.
Thanks
Code:
sSQL = "SELECT dbo.shows.credit as CRD, dbo.promoters.treasureremail as TE, dbo.venues.paymentnotes AS paynotes, dbo.venues.paymentaccountnumber as PAN, dbo.venues.paymentsort as PS, dbo.venues.paymentname as PN, dbo.shows.[get out] as GO, dbo.shows.[get in] as GI, dbo.shows.[Running Time] as RT, dbo.shows.sound AS Snd, dbo.shows.lighting as Lght, dbo.shows.stage as Stg, dbo.shows.[perf space] as perfsp, dbo.shows.layout as layout, dbo.eventslive.[print requirements] as PR, dbo.Promoters.address1 as PAdd1, dbo.Promoters.address2 as PAdd2, dbo.Promoters.name as PName, dbo.Promoters.town as PTown, dbo.Promoters.county as PCounty, dbo.Promoters.postcode as PPostcode, dbo.Promoters.email as Pemail, dbo.Promoters.[box office], dbo.Promoters.phone as Pphone, " & _
"dbo.Companies.mobile, dbo.companies.company, dbo.EventsLive.[event date], dbo.venues.[venue postcode] as VPostcode, dbo.EventsLive.Time, dbo.Companies.[Tel:], dbo.Companies.address1, dbo.Companies.address2, dbo.companies.[VAT Registered] as CVat, dbo.companies.[contact name],dbo.companies.[email] as Cemail, " & _
"dbo.EventsLive.AdultTP, dbo.EventsLive.FamilyTP, dbo.EventsLive.ChildTP, dbo.EventsLive.extraeventinfo, dbo.EventsLive.contractnotes, dbo.EventsLive.[Actual Cost of Show], dbo.EventsLive.[Accom costs etc],dbo.EventsLive.[Total Cost of Event]," & _
"dbo.Shows.[Show Name], dbo.shows.refresh as ikrefresh, dbo.shows.cost, dbo.eventslive.PromoShowCost, dbo.eventslive.PromoOnCosts, dbo.eventslive.PromoTotalCost," & _
"dbo.Companies.town as ctown, dbo.Companies.county as ccounty, dbo.Companies.postcode, dbo.EventsLive.EventID, dbo.EventsLive.webadultsold, dbo.EventsLive.webchildsold, dbo.EventsLive.webfamilysold," & _
"dbo.Venues.VENUE, " & _
"dbo.EventsLive.othertp, dbo.whichprojectlive.whichproject, dbo.EventsLive.[Promoter fee] FROM dbo.Companies INNER JOIN (dbo.Shows INNER JOIN (dbo.WhichProjectLive INNER JOIN (dbo.Venues INNER JOIN (dbo.Promoters INNER JOIN dbo.EventsLive " & _
"ON dbo.Promoters.ID = dbo.EventsLive.PromoterID) ON dbo.Venues.ID = dbo.EventsLive.VenueID) " & _
"ON dbo.WhichProjectLive.ID = dbo.EventsLive.WhichProject_ID) ON dbo.Shows.ID = dbo.EventsLive.ShowID) " & _
"ON dbo.Companies.ID = dbo.EventsLive.CompanyID " & _
"WHERE (((dbo.EventsLive.EventID)= '" & strFrmEventID & "' Or (dbo.EventsLive.EventID) Is Null));"
'OPEN THE RECORDSET AND EXECUTE
Set m_oRecordset = New ADODB.Recordset
m_oRecordset.Open sSQL, oConnection1, adOpenStatic, _
adLockBatchOptimistic, adCmdText
'm_oRecordset.MarshalOptions = adMarshalModifiedOnly
m_oRecordset.MarshalOptions = adMarshalAll
Set m_oRecordset.ActiveConnection = Nothing
'##count records for testing##
With m_oRecordset
'PASS THE RESULTS TO THE DoRemote ROUTINE
'if you get an error here about wrong number of arguments, then the proble might be in the Public Function DoRemote below... just saying...
Call DoRemote(Nz(!CRD, ""), Nz(!TE, ""), Nz(!paynotes, ""), Nz(!PAN, ""), Nz(!PS, ""), Nz(!PN, ""), Nz(!GO, ""), Nz(!GI, ""), Nz(!RT, ""), Nz(!Snd, ""), Nz(!lght, ""), Nz(!stg, ""), Nz(!perfsp, ""), Nz(!layout, ""), Nz(!pr, ""), Nz(!Company, ""), Nz(!ikrefresh, ""), Nz(!pNAME, ""), Nz(!cEmail, ""), Nz(![Show Name], ""), Nz(![event date], ""), Nz(!Time, ""), Nz(!Vpostcode, ""), Nz(!VENUE, ""), Nz(!AdultTP, ""), _
Nz(!ChildTP, ""), Nz(!FamilyTP, ""), Nz(!OtherTP, ""), Nz(!EventID, ""), Nz(!address1, ""), Nz(!address2, ""), Nz(!town, ""), _
Nz(!postcode, ""), Nz(![Tel:], ""), Nz(!mobile, ""), Nz(![Promoter Fee], ""), Nz(!extraeventinfo, ""), _
Nz(!contractnotes, ""), Nz(![Cvat], ""), Nz(![Box Office], ""), Nz(!WhichProject, ""), Nz(![contact name], ""), Nz(!padd1, ""), Nz(!padd2, ""), Nz(!Ptown, ""), Nz(!pcounty, ""), Nz(!ppostcode, ""), Nz(!pemail, ""), Nz(!PPhone, ""), _
Nz(![Actual Cost of Show], ""), Nz(![Accom costs etc], ""), Nz(![Total Cost of Event], ""), Nz(!WhichProject, ""), Nz(!PromoShowCost, ""), Nz(!PromoOnCosts, ""), Nz(!PromoTotalCost, ""), Nz(!WEBfamilySold, ""), Nz(!WEBadultSold, ""), Nz(!WEBchildSold, ""))
'CLOSE THE RECORDSET (GOOD HOUSE KEEPING) 23
m_oRecordset.Close
oConnection1.Close
Set m_oRecordset = Nothing
Set oConnection1 = Nothing
End With
End Sub
Public Function DoRemote(TE As String, paynotes As String, PAN As String, PS As String, PN As String, STRGO As String, STRGI As String, STRRT As String, _
STRSnd As String, lght As String, stg As String, perfsp As String, layout As String, pr As String, Company As String, refresh As String, str1PromoterName As String, cEmail As String, _
str3showname As String, dtDatefield As Date, str4time As String, Vpostcode As String, _
str5Venue As String, cur6AdultTP As String, cur7ChildTP As String, _
cur8FamilyTP As String, cur9othertp As String, str10EventID As Integer, _
str11ADDRESS1 As String, str12ADDRESS2 As String, str13TOWN As String, _
str14county As String, STR15POSTCODE As String, strTel As String, _
str17CoMobile As String, cur19Promoterfee As Currency, str20Extra As String, _
str21Contractnotes As String, strCoVAt As String, strBO As String, strWP As String, StrContactname As String, padd1 As String, padd2 As String, Ptown As String, pcounty As String, ppostcode As String, pemail As String, PPhone As String, _
strActualCostofShow As String, strAccomcostsetc As String, strTotalCostofEvent As String, strWhichProject As String, strPromoShowCost As String, strPromoOnCosts As String, strPromoTotalCost As String, strwebfamilysold As String, strwebAdultsold As String, strwebChildsold As String)