Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 09:16 PM
nkp
Guest
 
Posts: n/a
Default DDB again

Hello...getting an 'argument not optional' message when testing first
attempt at DDB
Option Explicit

Dim cost As Double
Dim salvage As Double
Dim life As Double
Dim period As Double
Dim factor As Variant
Dim depreciation As Double



Private Sub Command1_Click()
salvage = 200
life = 10
period = 1
factor = 2
cost = CDbl(Text1)
depreciation = DDB(((cost - salvage) * factor) / life) * period
Label2 = Format((depreciation), "000.00")


End Sub

....any suggestions much appreciated.

  #2  
Old July 17th, 2005, 09:16 PM
Kate
Guest
 
Posts: n/a
Default Re: DDB again

nkp <weatheredwall@btinternet.com> wrote in message news:<bom66a$ff8$1@titan.btinternet.com>...[color=blue]
> Hello...getting an 'argument not optional' message when testing first
> attempt at DDB
> Option Explicit
>
> Dim cost As Double
> Dim salvage As Double
> Dim life As Double
> Dim period As Double
> Dim factor As Variant
> Dim depreciation As Double
>
>
>
> Private Sub Command1_Click()
> salvage = 200
> life = 10
> period = 1
> factor = 2
> cost = CDbl(Text1)
> depreciation = DDB(((cost - salvage) * factor) / life) * period
> Label2 = Format((depreciation), "000.00")
>
>
> End Sub
>
> ...any suggestions much appreciated.[/color]
You've probably already figured this out, but Stephane was explaining
in that line what the function does, not how it's called. You are
providing only one argument here, the result of a calculation. You
need to provide the four arguments specified and let the function take
care of the calculation.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles