eaglewingmd
New member
- Local time
- Today, 06:21
- Joined
- Jun 4, 2010
- Messages
- 2
O.K. I have always had a problem conceptualizing scope and modules and variables and public and private. It’s like a mind road block.
I have a form that entries are made in text box controls. Below is the code and it works in the form on an AfterUpdate event.
I am finding that I need this code a few other places on the form so I thought I would just make it a module. So I put it in a subroutine in a module, then called it. And voila, nothing happens.
Do I need to declare variables in the module? If so then how do I get the information back into the text box controls on the form after the call? If that’s the case, why can’t I just use the variables from the form?
Thanks for any help and direction.
If gen = "M" Then
If WR <= MSW2 Then
fr = "Small"
low = MS1
high = MS2
ElseIf WR > MLW2 Then
fr = "Questionable"
low = MM1
high = MM2
ElseIf WR > MLW1 Then
fr = "Large"
low = ML1
high = ML2
Else
fr = "Medium"
low = MM1
high = MM2
End If
End If
I have a form that entries are made in text box controls. Below is the code and it works in the form on an AfterUpdate event.
I am finding that I need this code a few other places on the form so I thought I would just make it a module. So I put it in a subroutine in a module, then called it. And voila, nothing happens.
Do I need to declare variables in the module? If so then how do I get the information back into the text box controls on the form after the call? If that’s the case, why can’t I just use the variables from the form?
Thanks for any help and direction.
If gen = "M" Then
If WR <= MSW2 Then
fr = "Small"
low = MS1
high = MS2
ElseIf WR > MLW2 Then
fr = "Questionable"
low = MM1
high = MM2
ElseIf WR > MLW1 Then
fr = "Large"
low = ML1
high = ML2
Else
fr = "Medium"
low = MM1
high = MM2
End If
End If