PC Review


Reply
Thread Tools Rate Thread

help writing a simple function/expression

 
 
lynda
Guest
Posts: n/a
 
      30th Jan 2004
someone helped me write an expression in a module this
morning and when i closed the file i lost it. it was very
simple, i just don't know the format of how to rewrite it.
what i remember:
i was writing the function as so:

case is <10000
premiumsize="<10"
case is <20000
premiumsize="10 - 19"
case is <30000
premiumsize="20 - 29"
case us <40000
premiumsize="30 - 39"
etc, etc.

I have version 97. I need help writing the beginning and
the end of the function....like -
Function premiumsize (string) ...or something like that
for the beginning and
Function End ....or something like that for the end.

Do you need more information to help??

Thanks so much!!!
 
Reply With Quote
 
 
 
 
John Thomas
Guest
Posts: n/a
 
      30th Jan 2004
Looks like it was a Select Case statement.

Select Case YourValueHere

Case is <10000
premiumsize = "<10"

etc

End Select
>-----Original Message-----
>someone helped me write an expression in a module this
>morning and when i closed the file i lost it. it was

very
>simple, i just don't know the format of how to rewrite it.
>what i remember:
>i was writing the function as so:
>
>case is <10000
> premiumsize="<10"
>case is <20000
> premiumsize="10 - 19"
>case is <30000
> premiumsize="20 - 29"
>case us <40000
> premiumsize="30 - 39"
>etc, etc.
>
>I have version 97. I need help writing the beginning and
>the end of the function....like -
>Function premiumsize (string) ...or something like that
>for the beginning and
>Function End ....or something like that for the end.
>
>Do you need more information to help??
>
>Thanks so much!!!
>.
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      31st Jan 2004
Function PremiumSize(InputValue As Long) As String

Select Case InputValue
case is <10000
premiumsize="<10"
case is <20000
premiumsize="10 - 19"
case is <30000
premiumsize="20 - 29"
case is <40000
premiumsize="30 - 39"
case else
premiumsize = "unknown"
End Select

End Function

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)



"lynda" <(E-Mail Removed)> wrote in message
news:6f0301c3e769$913185b0$(E-Mail Removed)...
> someone helped me write an expression in a module this
> morning and when i closed the file i lost it. it was very
> simple, i just don't know the format of how to rewrite it.
> what i remember:
> i was writing the function as so:
>
> case is <10000
> premiumsize="<10"
> case is <20000
> premiumsize="10 - 19"
> case is <30000
> premiumsize="20 - 29"
> case us <40000
> premiumsize="30 - 39"
> etc, etc.
>
> I have version 97. I need help writing the beginning and
> the end of the function....like -
> Function premiumsize (string) ...or something like that
> for the beginning and
> Function End ....or something like that for the end.
>
> Do you need more information to help??
>
> Thanks so much!!!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing a vba code for a simple function niloy parvaz Microsoft Excel Programming 2 18th Nov 2009 02:52 PM
Writing a simple function in C# Jon Harrop Microsoft C# .NET 8 26th May 2007 10:37 AM
[Access/VBA] How to convert a RunMacro with a "repeat expression" in a simple function call ? (no more macro !) loran750-google@yahoo.fr Microsoft Access 3 10th Mar 2006 02:53 PM
Need help writing expression Laura Microsoft Access VBA Modules 5 18th Oct 2003 01:42 AM
writing a Sub versus writing a Function with no return value Mark Kamoski Microsoft VB .NET 4 9th Jul 2003 05:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:32 PM.