Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 6th, 2005, 09:11 AM
saabman saabman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 68 saabman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 34 m 21 sec
Reputation Power: 5
How to Call a Function

Hi!
What is it that allows me to Call a Function in another Function?

I have written a Function in a Module. Then I have written another Function in another Module. I want to call the first in the second but Sometimes it works and sometimes it doesn't. Should I declare in a specific way the function I want to call-up in other places?

Thanx for the help

Reply With Quote
  #2  
Old September 6th, 2005, 10:32 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
If your function is public then just

myResult = MyFunction(myArgs)
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old September 7th, 2005, 03:17 AM
saabman saabman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 68 saabman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 34 m 21 sec
Reputation Power: 5
Doug, thanx for your answer, but I still can't seem get it to work... I get the following error message: "Expected variable or procedure, not module"....

Reply With Quote
  #4  
Old September 7th, 2005, 09:20 AM
Jaykappy Jaykappy is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Feb 2005
Posts: 741 Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level)Jaykappy User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 9 h 29 m 50 sec
Reputation Power: 22
THIS CALLS A PRIVATE SUB....the Command8_Click is a Private Sub that starts off like this:

Private Sub Command8_Click()

Call Command8_Click



BELOW YOU SEE THE CALL COMMAND AGAIN....in this example it is calling the code below it....the Function Wait....when called it waits for a second.....

Call Wait(1, 1)

Function Wait(Delay As Integer, DispHrglass As Integer)

' This function creates a time delay you must use a call to run it Call Wait(2,1)

Dim DelayEnd As Double
DoCmd.Hourglass DispHourglass
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd) > 0
Wend
DoCmd.Hourglass False


HOPE THIS HELPS

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > How to Call a Function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT