I created a Public variable:
In the Current Event of a form, I set the variable:Code:Option Compare Database Option Explicit Public NumApplicantID As Integer
Code:Sub Form_Current() NumApplicantID = Me.ApplID ' Set the Applicant ID End Sub
Upon exit from this sub, the Public variable is no longer in scope and disappears. What am I doing wrong? I need to use that variable in another Event on a Button control on this same form.
I expect that it will be visible across the entire application.