ChrisCalvert
Technical User
I have a public function that I run, and I want it to increment a variable. I need a form module to use a mesagebox to display this value. I am not familliar with
using public variables and was wondering if anyone could just show me where to declare what. Do I have to pass the varaible to the function? Here is what my stuff looks like now:
The Form Module
---------------------------------------------
Option Compare Database
Public intBadTracker As Integer
Private Sub Command0_Click()
'code
MsgBox intBadTracker
End Sub
---------------------------------------------
The Module with the Function
------------------------------------
Option Compare Database
Public Function fctnCounter(Optional Var1, Var2 As String)
'various code
intBadCounter = intBadCounter +1
'other code
End Function
--------------------------------------
using public variables and was wondering if anyone could just show me where to declare what. Do I have to pass the varaible to the function? Here is what my stuff looks like now:
The Form Module
---------------------------------------------
Option Compare Database
Public intBadTracker As Integer
Private Sub Command0_Click()
'code
MsgBox intBadTracker
End Sub
---------------------------------------------
The Module with the Function
------------------------------------
Option Compare Database
Public Function fctnCounter(Optional Var1, Var2 As String)
'various code
intBadCounter = intBadCounter +1
'other code
End Function
--------------------------------------