Too Many Arguments (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 12:43
Joined
Sep 21, 2011
Messages
14,454
I am not really sure what that means Gasman to be honest. The thing is however ugly it looks it has been working, and i just want to add another field - which i thought would be simple!
Well my thoughts were pass m_oRecordset to the function instead, and then you would have everything you need.?
If the recordset increases by a few fields, they are then automatically included.?

So once tried and tested, maintenance free for any new fields in the recordset, plus you do not have to worry about type when passing.?
Not something I have done yet, or likely to TBH, but certainly something I would try, if I was in your situation.?
 
Last edited:

iankerry

Registered User.
Local time
Today, 12:43
Joined
Aug 10, 2005
Messages
190
Well my thoughts were pass m_oRecordset to the function instead, and then you would have everything you need.?
If the recordset increases by a few fields, they are then automatically included.?

So once tried and tested, maintenance free for any new fields in the recordset, plus you do not have to worry about type when passing.?
Not something I have done yet, or likely to TBH, but certainly something I would try, if I was in your situation.?

Thanks Gasman, sounds like it could be a great solution - but my grasp of coding is not that advanced sadly. Maybe withy all the self isolating i am going to be doing i could take a crash course!

cheers,

Ian
 

vba_php

Forum Troll
Local time
Today, 06:43
Joined
Oct 6, 2019
Messages
2,880
you'll do fine Ian. just make sure to crash on the bed in your own house and not on the cots in the back room here on the forum.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:43
Joined
Sep 21, 2011
Messages
14,454
Well I would have hoped it would be no more than

Code:
Call DoRemote(m_oRecordset)

Public Function DoRemote(pRS as DAO.Recordset) ' or ADO if that is what you are using
Dim strCRD as String..... etc

With pRS
strCRD = NZ(.CRD)

Then just use your variables, or even the recordset fields direct if you can.?, You did not show the rest of the function.?

HTH
 

iankerry

Registered User.
Local time
Today, 12:43
Joined
Aug 10, 2005
Messages
190
wait, there are cots i can crash in on the forum? o_O
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:43
Joined
Sep 21, 2011
Messages
14,454
wait, there are cots i can crash in on the forum? o_O
Well I might be on the forum a little more, as I am stuck in La in the USA at the moment and was planning on coming home next week.?
 

iankerry

Registered User.
Local time
Today, 12:43
Joined
Aug 10, 2005
Messages
190
Well I would have hoped it would be no more than

Code:
Call DoRemote(m_oRecordset)

Public Function DoRemote(pRS as DAO.Recordset) ' or ADO if that is what you are using
Dim strCRD as String..... etc

With pRS
strCRD = NZ(.CRD)

Then just use your variables, or even the recordset fields direct if you can.?, You did not show the rest of the function.?

HTH

well I have a few hours spare this afternoon, i might even give that a go!

i could paste the rest of the function but it is really ugly...:)
 

iankerry

Registered User.
Local time
Today, 12:43
Joined
Aug 10, 2005
Messages
190
Well I might be on the forum a little more, as I am stuck in La in the USA at the moment and was planning on coming home next week.?

That's not good. I wish you well and hope you get back here. and that you have a stock of toilet rolls.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:43
Joined
Sep 21, 2011
Messages
14,454
No need, but you would still need to check for values, hence I use new variables, then just use those with the NZ() function, just a little copy and paste.
only now I have noticed that your first parameter being passed is CRD and there is not one in the function?, it starts with TE.?

I believe once you get this working it would save you a lot of time if you need to modify again, and simpler to maintain, which I believe is always a good thing. :D
 
Last edited:

moke123

AWF VIP
Local time
Today, 07:43
Joined
Jan 11, 2013
Messages
3,940
Well I might be on the forum a little more, as I am stuck in La in the USA at the moment and was planning on coming home next week.?
La - Los Angeles or La - Louisianna? If the latter i hear @The_Doc_Man is a good cook with a spare room.
 

iankerry

Registered User.
Local time
Today, 12:43
Joined
Aug 10, 2005
Messages
190
No need, but you would still need to check for values, hence I use new variables, then just use those with the NZ() function, just a little copy and paste.
only now I have noticed that your first parameter being passed is CRD and there is not one in the function?, it starts with TE.?

I believe once you get this working it would save you a lot of time if you need to modify again, and simpler to maintain, which I believe is always a good thing. :D

Hi Gasman, thanks. I have some success with this at the moment - well I have managed to create an email for myself with some of the fields in need it. (a bit chuffed really coz this isn't my thing! but pride comes before a fall...)

can i ask a couple of quickies?

I obviously have my SQL statement

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,_

do i have to do a "Dim strCRD As String" for each one of these?

and then do i have to do this for each?

Code:
With pRS
strCRD = nz(!CRD)
strTE = nz(!te)
strPaynotes = nz(!paynotes)
strPAN = nz(!PAN)
StrEventdate = nz(!EvDt)

at the moment this code works and produces an email when it gets to this code (and more of course):
Code:
strMessage = strMessage & "________________" & strCRD & "________" & vbCrLf & vbCrLf
 
strMessage = strMessage & strTE & vbCrLf & vbCrLf

strMessage = strMessage & "________________" & strPaynotes & "___" & strPAN & vbCrLf & vbCrLf
 
strMessage = strMessage & "________________" & StrEventdate & "___" & vbCrLf & vbCrLf

Call SendAttachments("ik test " & strCRD, strMessage, "ian@artsalive.co.uk")

Hope I formatted this correctly.

thanks for any help.

Ian
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:43
Joined
Sep 21, 2011
Messages
14,454
La - Los Angeles or La - Louisianna? If the latter i hear @The_Doc_Man is a good cook with a spare room.
La to me is Louisana, LA is Los Angeles. I'm in Keithville, Shreveport - Bossier City area.
However I have managed to get a flight out tonight . (y)
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:43
Joined
Sep 21, 2011
Messages
14,454
Hi Gasman, thanks. I have some success with this at the moment - well I have managed to create an email for myself with some of the fields in need it. (a bit chuffed really coz this isn't my thing! but pride comes before a fall...)

can i ask a couple of quickies?

I obviously have my SQL statement

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,_

do i have to do a "Dim strCRD As String" for each one of these?

and then do i have to do this for each?

Code:
With pRS
strCRD = nz(!CRD)
strTE = nz(!te)
strPaynotes = nz(!paynotes)
strPAN = nz(!PAN)
StrEventdate = nz(!EvDt)

at the moment this code works and produces an email when it gets to this code (and more of course):
Code:
strMessage = strMessage & "________________" & strCRD & "________" & vbCrLf & vbCrLf

strMessage = strMessage & strTE & vbCrLf & vbCrLf

strMessage = strMessage & "________________" & strPaynotes & "___" & strPAN & vbCrLf & vbCrLf

strMessage = strMessage & "________________" & StrEventdate & "___" & vbCrLf & vbCrLf

Call SendAttachments("ik test " & strCRD, strMessage, "ian@artsalive.co.uk")

Hope I formatted this correctly.

thanks for any help.

Ian
Well if you can use the fields directly like
Code:
strMessage & NZ(!CRD,"")

then I would do that.?
 

Users who are viewing this thread

Top Bottom