Re: Passing an array to function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the good eye Roy.
Actually I had caught the end function, however, I didn't catch the
sArray(iTempCount) = ""

I probably would have if the error I received wasn't as strange.

It had said that it couldn't recognize the array passed - or some such
message. That had thown me off since I do not deal with arrays for the most
part.

Again, thanks Roy and I apologize for posting code with such a blatant error.


jerry

RoyVidar wrote:
"jer99 via AccessMonster.com" <u27295@uwe> wrote in message
<675db45f5171a@uwe>:
I've read through the messages here and have tried a number of
things. Still can't get this to work.
[quoted text clipped - 26 lines]

Anyone?

When I copy/paste your function into VBE, it first complains about
the last End Function, which is supposed to be End Sub. Then it
complains about Type Mismatch on the line

If iTempCount = "" Then

where you compare an integer with ZLS, which isn't supposed to be
possible. I don't know what you intend with this test, but I
suppose you could remove it. Or are you intending to test the
content of the array?

If sArray(iTempCount) = "" Then

When this is fixed, there's no complaint about missing array on my
setup. I suggest using Option Explicit at the top of each module,
which helps pick up such as this. To ensure this is turned on in
every new module, in Tools | Options, check "Require Variable
Declaration".


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200610/1

.



Relevant Pages

  • Re: Passing an array to function
    ... It had said that it couldn't recognize the array passed - or some such message. ... complains about Type Mismatch on the line ... I don't know what you intend with this test, ... I suggest using Option Explicit at the top of each module, ...
    (microsoft.public.access.modulesdaovba)
  • RE: Make all variable values in a Array equal to 0
    ... Option Explicit ... Private Sub btnApply_Click ... the Array issue it has clouded thought process. ... Lether Seats (CheckBox1 and var1) ...
    (microsoft.public.excel.programming)
  • Re: Is anything wrong with this formula?
    ... But perhaps Kelly did not intend to __count__ at all. ... And/or perhaps Kelly intended to compare two ranges in the __same__ worksheet, not one range in one named worksheet and the other range in the current worksheet, which is not necessarily the named worksheet. ... But when the boolean array is involved in an arithmetic operation, TRUE and FALSE are treated as 1 and 0 respectively, as intended. ...
    (microsoft.public.excel.worksheet.functions)
  • Clear Multidimensional Array Struc
    ... Option Explicit ... iDirection As Integer 'This will be the accumulation of all up and down ... iTotalUpClosePts As Single 'Total of all points for up days only ... I made the array Public because I need to access the information from ...
    (microsoft.public.vb.general.discussion)
  • Re: syntax for fixed array in C#?
    ... > I am making calls into a legacy DLL. ... > as a parameter a struct with several fields, each of which is a 40-char ... > array fields. ... > the compiler complains that it cannot convert a byte field to ...
    (microsoft.public.dotnet.general)