Help with this function...

G

Guest

I am running this application in Access 97 and are plugging the start and end
dates from the date controls on a report menu (which are actual dates from a
table) into hidden controls on the MainMenu form. The 2 global function below
are to grab those values and use them to set parameters for the reporting
queries. However, I keep getting date variable values such as: 38621 and
38626! Is there a modification which can be made to this function to show and
actual dates, or should some sort of formatting be used? These functions DO
NOT set the parameter as expected. Please, check them and let me know if
changes are required to them and where? I am open to suggestions, too.

Public Function RetrieveStartDateKey() As date

If IsNull(Forms![frmMainMenu]![txtStartDate]) Then
RetrieveStartDateKey = 0
Else
RetrieveStartDateKey = Forms![frmMainMenu]![txtStartDate]
End If

End Function

'-------------
Public Function RetrieveEndDateKey() As Date

If IsNull(Forms![frmMainMenu]![txtEndDate]) Then
RetrieveEndDateKey = 0
Else
RetrieveEndDateKey = Forms![frmMainMenu]![txtEndDate]
End If

End Function

Thanks,
 
D

Duane Hookom

38621 is 9/26/2005 and 6:00 AM on 9/26/2005 is 38621.25. This number appears
as a date when the value is formatted.
 
G

Guest

Thanks, Duane.



Duane Hookom said:
38621 is 9/26/2005 and 6:00 AM on 9/26/2005 is 38621.25. This number appears
as a date when the value is formatted.


--
Duane Hookom
MS Access MVP


Jay said:
I am running this application in Access 97 and are plugging the start and
end
dates from the date controls on a report menu (which are actual dates from
a
table) into hidden controls on the MainMenu form. The 2 global function
below
are to grab those values and use them to set parameters for the reporting
queries. However, I keep getting date variable values such as: 38621 and
38626! Is there a modification which can be made to this function to show
and
actual dates, or should some sort of formatting be used? These functions
DO
NOT set the parameter as expected. Please, check them and let me know if
changes are required to them and where? I am open to suggestions, too.

Public Function RetrieveStartDateKey() As date

If IsNull(Forms![frmMainMenu]![txtStartDate]) Then
RetrieveStartDateKey = 0
Else
RetrieveStartDateKey = Forms![frmMainMenu]![txtStartDate]
End If

End Function

'-------------
Public Function RetrieveEndDateKey() As Date

If IsNull(Forms![frmMainMenu]![txtEndDate]) Then
RetrieveEndDateKey = 0
Else
RetrieveEndDateKey = Forms![frmMainMenu]![txtEndDate]
End If

End Function

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top