Search results

  1. J

    Date Problem in VBA

    I cant get Year (Date)()) to work properly but this works fine now. If (Year(Nz([WCCClmDt1])) = Year(Date) - 1) Then WCCNF1 = "Yes" ElseIf (Year(Nz([WCCMRDt1])) = Year(Date) - 1) And _ (Year(Nz([wccmrdtwgt])) = Year(Date) - 1) And _ (Year(Nz([wccmrdthgt])) = Year(Date) - 1) Then WCCNF1 =...
  2. J

    Date Problem in VBA

    If it works how could it be invalid?
  3. J

    Date Problem in VBA

    If its invalid syntax then do you suggest I dont use it.
  4. J

    Date Problem in VBA

    Thanks for everyones response. Thankfully I was able to troubleshoot it but kind of interested in why it took Year(Date)-1) opposed to the other method.
  5. J

    Date Problem in VBA

    Interestingly I got it to work using the code below. The problem was the same flag was programmed on another exit at the bottom of the form which I didnt realize. Why is it accepting the format of Year(Date) - 1) when this is not supposed to? If (Year(Nz([WCCClmDt1])) = Year(Date) - 1) Then...
  6. J

    Date Problem in VBA

    I am having great difficulty trying to resolve this. WCCNF1 should turn to yes for previous dates in 2015 not 2016. I cant get it to work using -1. If Year = 2015 it should turn to Yes. Can anyone help me? If (Year(Nz([WCCClmDt1])) = Year(Date)()) Then WCCNF1 = "Yes" ElseIf...
  7. J

    Validate Form Date only for Current Year

    Hey Guys, When I use this code which works in a test database it wont work in the box in my database. It comes up with Run Time Error "94" Invalid use of Null. Date entered has to be in the current calander year. Code is as follows: Private Sub dataentry1_BeforeUpdate(Cancel As Integer) If...
  8. J

    Run Time Error 2465 cant find the field "fieldname" referred in your expression

    Re: Run Time Error 2465 cant find the field "fieldname" referred in your expression It worked. Thanks. Private Sub review_date2_Click() ' select entier field Me![review date2].SelStart = 0 End Sub
  9. J

    Run Time Error 2465 cant find the field "fieldname" referred in your expression

    Re: Run Time Error 2465 cant find the field "fieldname" referred in your expression Thanks. I inherited the database this is how it was developed. I should remove the "_" in the code and just put it in brackets.
  10. J

    Run Time Error 2465 cant find the field "fieldname" referred in your expression

    Run Time Error 2465 cant find the field "fieldname" referred in your expression Anyone know the solution to the following on a field on a form: Once field is clicked, pop up message: Run Time Error 2465 cant find the field review_date 2 referred in your expression. The debug brings you right...
  11. J

    David Crake – very sad news

    I have so much respect and care for everyone in this forum. So sorry for everyone's loss. May he stay in our hearts and thoughts.
  12. J

    Validate Form Date only for Current Year

    Too many dates on form to roll it into form update. It would have to be on exit for the field. Date is always entered 00/00/00 and various validation rules. Thanks
  13. J

    Validate Form Date only for Current Year

    Interestingly the form before update didn't work but I used it on an Event Exit and it worked fine. Thanks.
  14. J

    Validate Form Date only for Current Year

    I just looked at it. Im trying to make it more portable from year to year so it doesnt have to be changed from year to year. So in 2017 they would have to change it to 2017. Some cases the dates are for the last two years, some for only current year, and some for last (5) years which is how I...
  15. J

    Validate Form Date only for Current Year

    Thanks. I do use VBA frequently and it is part of my job. I just havent coded this type >=DateSerial(Year(Date()),1,1) And <=DateSerial(Year(Date()),12,31) Or Is Null. Thanks so much. Ill take a look.
  16. J

    Validate Form Date only for Current Year

    It doesnt make sense to me but Im guessing your talking about puttting into VBA.
  17. J

    Validate Form Date only for Current Year

    Also any way I can allow dates to be restricted for past two years? So in 2017, only dates from 1/1/2015 to 12/31/2016 can be entered and in 2018 only 1/1/2016 - 12/31/2017 can be entered
  18. J

    Validate Form Date only for Current Year

    I wrote this validation rule which I will add on all my forms for dates requiring dates meant for only current year. I tested it and only takes dates for 2016 which is correct. I want to confirm from more seasoned developers that this will work year to year so in 2017 will only take 2017 dates...
  19. J

    Scheduling Email with Attachment

    Just run it. Makes sense. I should have known it.
  20. J

    Scheduling Email with Attachment

    Ok Thanks. I dont see an option with autoexec macro but look into it.
Back
Top Bottom