Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005

    Unanswered: Invalid outside procedure

    I've created a module called globalVariables which is:
    Option Compare Database

    Global jobNumber As String

    Public set_Job_Number(txtIn) As Integer

    jobNnumber = txtIn
    MsgBox jobNumber

    End Sub

    Public Function get_Job_Number() As String

    get_Job_Number = jobNumber

    End Function

    I'm using this pass a variable between a form and a report. when I open the form i get the error message invalid outside procedure with the cursor next to jobnumber = txtIn

    Can any one explain why??

  2. #2
    Join Date
    Feb 2005

    using string instead of integer not declaring a sub and a typo

  3. #3
    Join Date
    Feb 2004
    Chicago, IL
    You might consider using the OpenArgs variable of the DoCmd.OpenReport method. That way you don't have to have a global variable.

    If your application encounters an error that is not handled by your application, all of your global variables get wiped out. This may not be a problem for you but in mine case I figured out a way not to use global variables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts