Connecting Tech Pros Worldwide Forums | Help | Site Map

Help with function in Access

Andreas Schittlipz
Guest
 
Posts: n/a
#1: Nov 12 '05
Hallo Newsgroup!
I am wanting to write a function using VBA - but I don't know why.
Please can someone help?

Andreas Schittlipz
Germany



Rick Brandt
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Help with function in Access


"Andreas Schittlipz" <andreas@schittlipz.com> wrote in message
news:bqnf22$rh4$1@hercules.btinternet.com...[color=blue]
> Hallo Newsgroup!
> I am wanting to write a function using VBA - but I don't know why.
> Please can someone help?[/color]

Simple example in a standard module...

Public Function AddTwoNumbers(FirstNum As Double, SecondNum As Double) As
Double
AddTwoNumbers = FirstNum + SecondNum
End Function

Testing in the Immediate pane of the debug window...

?AddTwoNumbers(12.5, 6.25) <Enter>
18.75

Of course for more complex functions you would also need error handling and
proper house cleaning code if you open any objects, etc..


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Larry Linson
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Help with function in Access


"Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
news:bqng89$24djlo$1@ID-98015.news.uni-berlin.de...[color=blue]
> "Andreas Schittlipz" <andreas@schittlipz.com> wrote in message[/color]

You took Don P Mellon's bait, Rick.

Should have read it more carefully... he didn't ask "how", he asked "why" he
wanted to write a function in VBA.

It'll be interesting, I guess, to see if/how Mellon, aka Schittlipz, follows
up, now that he's "been busted."


Rick Brandt
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Help with function in Access


"Larry Linson" <bouncer@localhost.not> wrote in message
news:MIyAb.1293$nz.861@nwrddc01.gnilink.net...[color=blue]
> "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
> news:bqng89$24djlo$1@ID-98015.news.uni-berlin.de...[color=green]
> > "Andreas Schittlipz" <andreas@schittlipz.com> wrote in message[/color]
>
> You took Don P Mellon's bait, Rick.
>
> Should have read it more carefully... he didn't ask "how", he asked "why" he
> wanted to write a function in VBA.
>
> It'll be interesting, I guess, to see if/how Mellon, aka Schittlipz, follows
> up, now that he's "been busted."[/color]

I saw the "why" and assumed it was a second language goof. Oh well.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Closed Thread