|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello, I made a function on a macro in MS Access and I call
for it from a report. This is the call inside a text box =CambiaADec([strData]) it works fine because i set a break point in the macro but it doesn't return the value to the form, how can I do that? Thanks already, please reply also to my email address hxlx@hotmail.com SEE ANSWER HERE Function name should be assigned the value you have arrived in the last line as follows Public Function WhichWeek(InDate As Date) As Integer Dim EnteredDate As Date EnteredDate = InDate FirstDateCount = WeekDay(GetDate(EnteredDate, "Current", "First")) If DatePart("d", InDate) <= FirstDateCount Then WhichWeek = 1 Else WhichWeek = 1 + Int(DatePart("d", InDate) - FirstDateCount) / 7 End If End Function Last edited by hxlx : February 17th, 2004 at 10:44 AM. Reason: ANSWERED ALREADY |
|
#2
|
||||
|
||||
|
Function name should be assigned the return value of the function as follows.
Public Function WhichWeek(InDate As Date) As Integer Dim EnteredDate As Date EnteredDate = InDate FirstDateCount = WeekDay(GetDate(EnteredDate, "Current", "First")) If DatePart("d", InDate) <= FirstDateCount Then WhichWeek = 1 Else WhichWeek = 1 + Int(DatePart("d", InDate) - FirstDateCount) / 7 End If End Function
__________________
V.Subramanian |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Help On Returning Value On Function In Ms Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|