Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    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

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    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.

  3. #18
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    Can you pls give me with solution in table with new field with all no of days for start_date.

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    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.

  5. #20
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    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.

  6. #21
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    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.

  7. #22
    Naveen Marapaka is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    33
    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

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using check boxes
    By pbouk in forum Access
    Replies: 7
    Last Post: 12-12-2012, 06:49 PM
  2. Check Boxes
    By manic in forum Programming
    Replies: 5
    Last Post: 06-26-2012, 09:18 AM
  3. To check or Un-Check all Boxes in a form
    By devcon in forum Forms
    Replies: 7
    Last Post: 05-01-2010, 12:03 AM
  4. Un-Check all Boxes
    By cotri in forum Forms
    Replies: 4
    Last Post: 04-30-2010, 12:53 PM
  5. check boxes
    By chiefmsb in forum Forms
    Replies: 1
    Last Post: 11-14-2006, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums