A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

user defined functions



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 06:36 PM
victor
external usenet poster
 
Posts: n/a
Default user defined functions

where are saved these functions ? o how do i save one ?
and how can i run it with a command button ?
  #2  
Old June 4th, 2004, 09:40 PM
fredg
external usenet poster
 
Posts: n/a
Default user defined functions

On Fri, 4 Jun 2004 10:36:03 -0700, victor wrote:

where are saved these functions ? o how do i save one ?
and how can i run it with a command button ?


User Defined functions are functions you design yourself to return a
value.
They are stored in a Module.
On the main database folder, click on Modules
Write your function in the code window that opens:

Function DoSomething(FieldIn)
'Function code goes here
DoSomething = some value
End Function

Exit the module and save it under a name other than "DoSomething".

You can run it from a query, Control Source, or code event.

As a control source:
=DoSomething([FieldName])

From a command button event:
strResult = DoSomething ([FieldName])

From a query:
ExpoSomething([FieldName])
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.