Query Criteria

Jody
06-19-2001, 01:53 PM
My question is... I have a quick function for an input Box to retreive a Date. I
did this so I could use the same value though out a report with many sub-reports
in it. Here is the Function:

Public Function GetRptDate() As Date
varInput = InputBox("Enter Report Date", "Report Date")
If IsDate(varInput) = False Then
MsgBox "Invalid input", vbCritical
Exit Function
Else
'input is good
GetRptDate = CDate(varInput)
End If
End Function

Simple enough... Now when I put GetRptDate() in the criteria box of my cross-tab
query, it brings up the Input Box, accepts the date entered, but It will not
return to run the query. It asks me to enter the date over again in some loop. Am
I missing something? Any help would be greatly appreciated.

Thanks,
Jody

Mill
06-19-2001, 01:59 PM
It looks to me like the problem is not in the function that you listed, but in the call to that function or the code around that call.

Jody
06-19-2001, 02:04 PM
Well here is the SQL statement, can anyone see what I'm missing?TRANSFORM Count([Daily Tally].Specimen_Key) AS CountOfSpecimen_Key
SELECT [Daily Tally].DateReceived, Count([Daily Tally].Specimen_Key) AS [Total Of Specimen_Key]
FROM [Daily Tally]
WHERE ((([Daily Tally].DateReceived)=GetRptDate()))
GROUP BY [Daily Tally].DateReceived
PIVOT [Daily Tally].Headings;

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum