Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

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 July 1st, 2009, 11:29 AM
accessarmyof1 accessarmyof1 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 31 accessarmyof1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 5 m 45 sec
Reputation Power: 1
General question about modules - SOLVED!

I was just wondering when you write a function into a module in access, how does that work? Can you call a module function with a button click like a sub procedure?

Just curious....never work with anything beyond VBA subs in access.
Could anyone explain this to me please?
Thanks!

Last edited by accessarmyof1 : July 1st, 2009 at 04:05 PM. Reason: Question Answered/Solved

Reply With Quote
  #2  
Old July 1st, 2009, 01:53 PM
rpeare rpeare is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2008
Posts: 1,093 rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 23 h 52 m 46 sec
Reputation Power: 227
Functions are usually used for events that you do over and over and over again in your database for instance let's say you want to make field_001 through field_005 invisible if another field is checked

you could have a function that was something like this

Code:
Function make_invisible()

    Fld_001.Visible = False
    Fld_002.Visible = False
    Fld_003.Visible = False
    Fld_004.Visible = False
    Fld_005.Visible = False
    
End Function

Function make_visible()

    Fld_001.Visible = True
    Fld_002.Visible = True
    Fld_003.Visible = True
    Fld_004.Visible = True
    Fld_005.Visible = True
    
End Function

Private Sub Chk_001_Click()

If Chk_001 = -1 Then
    Call make_invisible
Else
    Call make_visible
End If

End Sub


You can also pass variables to a function and have it return a value to your original code for instance if you wanted to use a function to calculate volume then return the volume figure to your code for some follow up you could do that too.
__________________
----------------
If we've helped you and you have solved your problem please post that it's been resolved so we know! The suspense kills me!

Reply With Quote
  #3  
Old July 1st, 2009, 04:05 PM
accessarmyof1 accessarmyof1 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 31 accessarmyof1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 5 m 45 sec
Reputation Power: 1
Oh I see!! Thanks very much....so to call the function its:

call "function name"?

wow, i can't believe I did not know that...you just saved me a WHOOOOOOOLLLLOTTA time! Appreciate it very much!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > General question about modules


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





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek