Error 2465

W

WCDoan

I have a subform and I'm using the following statement in an event

Dim FeeRenewalDate As Date
FeeRenewalDate = DateSerial(Year([Me.FeeDate]), Month([Me.FeeDate]) + 12,
Day([Me.FeeDate]))

I keep getting error 2465 - Microsoft Access can't find the field '|'
referred to in your expression. I don't see it, but I may not know what to
look for. Could someone tell me what I'm doing wrong here.

Thanks,
RandyM
 
J

Jeff Conrad

Either use:

Dim FeeRenewalDate As Date
FeeRenewalDate = DateSerial(Year(Me.FeeDate), _
Month(Me.FeeDate) + 12, Day(Me.FeeDate))

or

Dim FeeRenewalDate As Date
FeeRenewalDate = DateSerial(Year([FeeDate]), _
Month([FeeDate]) + 12, Day([FeeDate]))

By enclosing Me.FeeDate in [] Access is looking for a field
in the recordset called literally Me.FeeDate which of course does not exist.
--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
 
W

WCDoan

Jeff,
Thanks so much. That cleared it right up. I copied that from somewhere,
don't remember and it had the brackets, so I used them. I'm still relatively
new to Access tho' thanks to everyone here's help, reading books and
articles, and following links that yall post, I think I might be on the road
to turning into a 'junkie' myself. Hope I can make it! :)

Thanks again,
RandyM

Jeff Conrad said:
Either use:

Dim FeeRenewalDate As Date
FeeRenewalDate = DateSerial(Year(Me.FeeDate), _
Month(Me.FeeDate) + 12, Day(Me.FeeDate))

or

Dim FeeRenewalDate As Date
FeeRenewalDate = DateSerial(Year([FeeDate]), _
Month([FeeDate]) + 12, Day([FeeDate]))

By enclosing Me.FeeDate in [] Access is looking for a field
in the recordset called literally Me.FeeDate which of course does not exist.
--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
I have a subform and I'm using the following statement in an event

Dim FeeRenewalDate As Date
FeeRenewalDate = DateSerial(Year([Me.FeeDate]), Month([Me.FeeDate]) + 12,
Day([Me.FeeDate]))

I keep getting error 2465 - Microsoft Access can't find the field '|'
referred to in your expression. I don't see it, but I may not know what to
look for. Could someone tell me what I'm doing wrong here.
 
J

Jeff Conrad

A

Access User

My code is getting one of them also. Below is it:

Private Sub Form_AfterUpdate()

Call LockBoundControls(Me, Nz(Me("MRA_Form").Form!Complete.Value, False),
"Complete")

End Sub

Private Sub Form_Current()

Call LockBoundControls(Me, Nz(Me("MRA_Form").Form!Complete.Value, False),
"Complete")

End Sub

I'm referring to the control 'Complete' which is on a sub-form of the
parent's. How do I satisfy the compiler?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top