Recent content by bleep-blop

  1. B

    Hide Main DB window - only show form - ACCESS 2010

    Hi, I have used this code, and it works nicely. I have the fSetAccessWindow (SW_SHOWMINIMIZED) on the ONload for every form. I have only one small issue, When the user uses another program or opens up mydocuments etc then switches back to access. The Grey background behind my popup forms...
  2. B

    VBA filter Syntax

    Ah thank you so much :) always feel silly when it something that simple lol Cheers :)
  3. B

    VBA filter Syntax

    Hi, very quick question. This filter vba doesnt work Me.Filter = "abcode= " & i And "EmpASID = " & f Me.FilterOn = True runtime error 13 type mismatch. Both Abcode and EmpASID are Numerical. So is i and f Me.Filter = "abcode= " & i works fine on its own Me.Filter = "EmpASID...
  4. B

    Converting Dates into week numbers

    Hi David, Yes it is solved :) I have adapted your idea of a lookup table and namliam's code to create a lookup table. I ran a simple loop function to record the date with its week number-year (1st day of the week) so i can easily convert a week number to a date and use that date+6 days as a...
  5. B

    Converting Dates into week numbers

    Just finished testing it on a few items. I believe it works too :) ty very much :) I will use this to get the weeknumber only. And my code to get the weeknumber + year. Again, thank you very much :) Iv stumbled, tripped and fell along the way while writing this code, but it is now solved :)...
  6. B

    Converting Dates into week numbers

    Public Function getWKN(test As Date) Dim prevsun As Date Dim YN As Date WKN = DatePart("ww", test, vbSunday, vbFirstJan1) iyear = Year(test) MsgBox iyear If WKN = 53 Then prevsun = (test - Weekday(test) + 1) If prevsun <> CDate("25/12/" & Year(test)) Then WKN = 1 YN = DateAdd("yyyy", 1, test)...
  7. B

    Converting Dates into week numbers

    I think i have it Public Function getWKN(test As Date) As Integer Dim prevsun As Date WKN = DatePart("ww", test, vbSunday, vbFirstJan1) If WKN = 53 Then prevsun = (test - Weekday(test) + 1) If prevsun <> CDate("25/12/" & Year(test)) Then WKN = 1 Else WKN = 53 End If End If getWKN = WKN End...
  8. B

    Converting Dates into week numbers

    Yeah, tell me about it lol... :) Basically this system is used to keep weeks "whole" for their absence stats. in my example dates above - week 53 of 2013 is only 3 days long and week 1 of 2014 is 4 days long. They basically start the year 3 days early to capture 1 whole week. Im being paid...
  9. B

    Converting Dates into week numbers

    Function DatePartCheck(dateChecked as Date) As Integer Dim yearStart as Date Dim yearCheck, i as Integer i = DatePart("ww", dateChecked, vbSunday, vbFirstJan1) If i = 53 Then yearCheck = Year(dateChecked) +1 yearStart = Dlookup("startDate","lookupTable", "inYear = " & yearCheck) If...
  10. B

    Converting Dates into week numbers

    Thanks david, I will write up a lookup table tonight then run your code, it looks promising :) Thanks for all the advice so far :)
  11. B

    Converting Dates into week numbers

    Private Sub Command2_Click() Dim Test As Date Dim yy As Date Test = Text0 yy = Year([Test]) If Test >= "25/12" & yy Then MsgBox Weekday("25/12" & yy) If Day("25/12" & yy) = 25 Then WeekNum = 53 Answer = WeekNum & "-" & yy MsgBox Answer End If Else 'it uses the getweeknum function MsgBox...
  12. B

    Converting Dates into week numbers

    If the last sunday of the year is the 25th of December then that is week 53, if the last sunday is greater after the 25th then that sunday starts week 1 of the next year. Private Sub Command2_Click() Dim Test As Date Test = Text0 checker = Test - Weekday(Test) + 1 'finds the previous sunday...
  13. B

    Converting Dates into week numbers

    ? DatePart("ww", "29/12/2013", vbSunday, vbFirstJan1) 53 Gives me week 53-2013 when it should be week 1 of 2014, How would I adjust this using a lookup table?
  14. B

    Converting Dates into week numbers

    Unfortunately the option in access do not :( thanks for the support :)
  15. B

    Converting Dates into week numbers

    Yeah, you are right, Thanks for spotting it. It also fails (so far) at 12/25/2033, Im still trudging through checking all the results. Looking for a pattern. I have checked manually the week numbers if you start week 1 2022 as 12/26/21 Then 12/25/22 should be week 53 as it its whole week is...
Top Bottom