Calling Module Values in Form Sub

chot

New member
Local time
Yesterday, 22:08
Joined
Mar 22, 2011
Messages
5
I can't seem to figure out how to store a value in my Module subroutine and then pull that value in my Form Subroutine.

Ex. Module
Public Sub exMod(ckIssue as Double)
ckIssue = 2
End Sub

Ex. Form Code
Public Sub Button_Click()
Dim ckIssue as Double
MsgBox(ckIssue)
If ckIssue >= 0 Then
Goto Exit_Sub
Else
DoCmd.OpenReport acPreview
End If
End Sub

I always get a blank value when I run the form code.

Any Suggestions?
 
You're not doing anything with the variable in the function (located in the Standard Module) so just declare a Public variable in the Standard Module:
Code:
Public clickIssue As Double
You can use it as you would use any other variable.
 
Do put that in my 'Check' code or make a new sub in a different module?
 
Oops... that should have been

Public ckIssue As Double

Put it in your Ex. Module at the top part just below the line that reads Option Compare Database
 

Users who are viewing this thread

Back
Top Bottom