Hi dear,
comming to your method, Is it possible to store the number of days of month of Start_Date in Table ? if we take new field in table.
pls explain
Hi dear,
comming to your method, Is it possible to store the number of days of month of Start_Date in Table ? if we take new field in table.
pls explain
It's not my method, just something I helped someone with that might be useful to your situation.
You can certainly store the number of days in month or calculate when needed.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Can you pls give me with solution in table with new field with all no of days for start_date.
Give you what solution? I can't build database for you. Think I have helped all I am able to.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DB i already attached previously so kindly generate no of days of month in new field. my main problem was how to get number of days!, i got your idea but to implement it, i am looking for solution in DB.
Google: Access calculate number of days in month
http://support.microsoft.com/kb/210448
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
anyhow thanks for your posts.
I did what i want, without storing values in table,
A simple coding in report itself made my job easy. i just created a textfield in main form which is hidden actually to pull the value of no of days of month of start_date field of subform
Code:Daysofmonth.Value = DAY(DateSerial(Year(Me.DaysofLeave.Form!Start_Date), Month(Me.DaysofLeave.Form!Start_Date) + 1, 0))
then in report i pulled the value of textfield of main page, and used in my report load event, below code worked perfect.
Code:If Format(Forms!Mainpage.DaysofLeave.Form.Start_Date, "mm") & Format(Forms!Mainpage.DaysofLeave.Form.Start_Date, "yyyy") = Format(Forms!Mainpage.DaysofLeave.Form.Join_Date, "mm") & Format(Forms!Mainpage.DaysofLeave.Form.Join_Date, "yyyy") Then intStart = Format(Forms!Mainpage.DaysofLeave.Form.Start_Date, "dd") intEnd = Format(Forms!Mainpage.DaysofLeave.Form.Join_Date, "dd") For i = intStart To intEnd - 1 Me.Controls("D" & i) = True Next Else intStart = Format(Forms!Mainpage.DaysofLeave.Form.Start_Date, "dd") intEnd = Format(Forms!Mainpage.DaysofLeave.Form.Join_Date, "dd") For i = intStart To Forms!Mainpage.Daysofmonth.Value Me.Controls("D" & i) = True Next For i = 1 To intEnd - 1 Me.Controls("DD" & i) = True Next End If End Sub