|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#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 |
|
#2
|
|||
|
|||
|
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! |
|
#3
|
|||
|
|||
|
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! |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > General question about modules |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|