use an array when calling a function from a query field

k0r54

Registered User.
Local time
Today, 23:14
Joined
Sep 26, 2005
Messages
94
Hi,

In the query field i am putting: -
Code:
Consecutive Months: Query_Month_Consecutive([Report_2_group_data].[Availability], array([Monthly_availability_CT].[12],[Monthly_availability_CT].[11],[Monthly_availability_CT].[10],[Monthly_availability_CT].[9],[Monthly_availability_CT].[8],[Monthly_availability_CT].[7],[Monthly_availability_CT].[6],[Monthly_availability_CT].[5],[Monthly_availability_CT].[4],[Monthly_availability_CT].[3],[Monthly_availability_CT].[2],[Monthly_availability_CT].[1]))

Basicly the values of them fields are entered into the query, all fields exist and everything is ok.

Anyhow the function is not loaded, i have tested with a simple msgbox and it does not do it.

However when i simply do
Code:
Consecutive Months: Query_Month_Consecutive([Report_2_group_data].[Availability], Monthly_availability_CT].[12)

It works and the msg box appears?

I really need it to be an array for what im doing any help would be great

Thanks
k0r54
 
Can you post the function Query_Month_Consecutive?
 
This is the function with just the msgbox in it and the actuall function commented out
Code:
Function Query_Month_Consecutive(Now, M)
  MsgBox "boo"
'  ' Declare variables
'  cnt = 0
'  MonthEquiv = 12
'
'  ' Step through the 12 months (because the array is in backwards must + 1 to now and because array starts at 0 not 1, + 11 not 12
'  For MonthN = MonthEquiv To MonthEquiv + 11
'
'    ' If it reaches 12 it must go back to 0
'    If (MonthN > 12) Then MonthV = MonthN - 12 Else MonthV = MonthN
'
'    ' - 1 from Month Value
'    MonthV = MonthV - 1
'
'    'If (M(MonthV) < 90) Then cnt = cnt + 1 Else GoTo The_go_to
'  Next MonthN
'
'The_go_to:
'  Query_Month_Consecutive = cnt
'  Exit Function
End Function
 

Users who are viewing this thread

Back
Top Bottom