Results 1 to 3 of 3

Thread: Odd things happening with this function

  1. #1
    Guest

    Question

    I have the procedure

    Private Sub PopulateSupplier(storage() As clsMRItem)

    End Sub

    If I try and reference storage(x).something as the first thing I do, it works just fine.

    If, on the other hand I were to add these 2 lines into the procedure,

    Public LineNo As Integer
    Public Offset as Integer

    I am unable to reference storage(x).something.

    Unless I am way off the mark, those 2 lines of code should nto do anything of the sort. I have no other variables with those names (global or otherwise). If you have seen something like this, please let me know what's going on.



  2. #2
    Member FrogBoy666's Avatar
    Join Date
    Aug 2000
    Location
    Columbia, SC
    Posts
    34

    Try this...

    To make them local variables, try using Dim instead of Public...

    Code:
    Private Sub PopulateSupplier(storage() As clsMRItem)
    
        Dim LineNo As Integer 
        Dim Offset As Integer 
    
        ' The rest of the sub code...
    
    End Sub
    Or, if you want them to be public try putting them in the declarations section at the top of the form's code or a module's code.

    Code:
    Option Explicit
    
    Public LineNo As Integer 
    Public Offset As Integer
    ______________________________________________________
    
    Private Sub PopulateSupplier(storage() As clsMRItem)
    
        ' The rest of the sub code...
    
    End Sub
    Good luck!


  3. #3
    Guest
    Thanks... I tried that right after I posted and it worked fine.

Posting Permissions

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



Click Here to Expand Forum to Full Width