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 =...
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.
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...
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...
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...
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
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.
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...
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
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...
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.