I'm trying to get back a value in a report with a textbox calling the function like this:
="District " & get_values([District],[div],27) I'm only getting back "District" , in other words, nothing This will be used in the district footer I know the function is finding values because the message boxes in the code below show the values I expect Function get_values(dist As String, div As String, fieldN As Integer) As String Dim ctr As Integer For ctr = 0 To UBound(district) - 1 If Trim(dist) = Trim(district(ctr).district) Then If fieldN = 0 Then getValues = CStr(district(ctr).sum_Proj_actual) Exit Function End If If fieldN = 1 Then getValues = CStr(district(ctr).sum_mtd_ty_ret) Exit Function End If If fieldN = 2 Then getValues = CStr(district(ctr).sum_mtd_ly_ret) Exit Function End If If fieldN = 3 Then getValues = CStr(district(ctr).sum_days_ly) Exit Function End If If fieldN = 4 Then getValues = CStr(district(ctr).sum_days_ty) Exit Function End If If fieldN = 5 Then getValues = district(ctr).district MsgBox getValues Exit Function End If If fieldN = 6 Then getValues = CStr(district(ctr).sum_st_Area) Exit Function End If If fieldN = 7 Then getValues = CStr(district(ctr).sum_mtd_proj) Exit Function End If If fieldN = 8 Then getValues = CStr(district(ctr).sum_ly_qty) Exit Function End If If fieldN = 9 Then getValues = CStr(district(ctr).sum_ly_trans) Exit Function End If If fieldN = 10 Then getValues = CStr(district(ctr).sum_mtd_ly_hrs) Exit Function End If If fieldN = 11 Then getValues = CStr(district(ctr).sum_mtd_ly_plc) Exit Function End If If fieldN = 12 Then getValues = CStr(district(ctr).sum_ty_qty) Exit Function End If If fieldN = 13 Then getValues = CStr(district(ctr).sum_ty_trans) Exit Function End If If fieldN = 14 Then getValues = CStr(district(ctr).sum_ty_hrs) Exit Function End If If fieldN = 15 Then getValues = CStr(district(ctr).sum_ty_rtns) Exit Function End If If fieldN = 16 Then getValues = CStr(district(ctr).sum_ty_plcc) Exit Function End If If fieldN = 17 Then getValues = CStr(district(ctr).sum_comp_ty) Exit Function End If If fieldN = 18 Then getValues = CStr(district(ctr).sum_comp_ly) Exit Function End If If fieldN = 19 Then getValues = CStr(district(ctr).sum_ads_ly) Exit Function End If If fieldN = 20 Then getValues = CStr(district(ctr).sum_ads_ty) Exit Function End If If fieldN = 21 Then getValues = CStr(district(ctr).sum_ADS_Chg) Exit Function End If If fieldN = 22 Then getValues = CStr(district(ctr).sum_DPH_Ty) Exit Function End If If fieldN = 23 Then getValues = CStr(district(ctr).sum_DPH_LY) Exit Function End If If fieldN = 24 Then getValues = CStr(district(ctr).sum_delta_dph) Exit Function End If If fieldN = 25 Then getValues = CStr(district(ctr).rtn_pct) Exit Function End If If fieldN = 26 Then getValues = CStr(district(ctr).dist2) Exit Function End If If fieldN = 27 Then getValues = CStr(district(ctr).div) MsgBox getValues Exit Function End If End If Next End Function Why am I not getting anything back? Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/