#Name? error in Formula

F

forest8

Hi there

As I mentioned in the subject line, I am currently getting a @Name? error in
a formula.

The formula I have is

=DateDiff("yyyy",[DateofBirth],Date())-IIf(Format(Date(),"mmdd")>Format([DateofBirth],"mmdd"),0,1)

I noticed that the field should be [Date of Birth] but when I try to edit
the formula, the formula change does not stick.

How do I get the formula to stick?

Thank you for your help in advance.
 
T

Tom Wickerath

What is the name of the text box in question? Is it DateofBirth? If so, try
changing it to txtDateOfBirth. Then see if Access will let you adjust the
formula.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
F

forest8

The Text box is called [Date of BIrth] (with spaces bewtween the words.



Tom Wickerath said:
What is the name of the text box in question? Is it DateofBirth? If so, try
changing it to txtDateOfBirth. Then see if Access will let you adjust the
formula.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

Hi there

As I mentioned in the subject line, I am currently getting a @Name? error in
a formula.

The formula I have is

=DateDiff("yyyy",[DateofBirth],Date())-IIf(Format(Date(),"mmdd")>Format([DateofBirth],"mmdd"),0,1)

I noticed that the field should be [Date of Birth] but when I try to edit
the formula, the formula change does not stick.

How do I get the formula to stick?

Thank you for your help in advance.
 
T

Tom Wickerath

Do you have Name Autocorrect (aka Name Autocorrupt) enabled?
I just tried your expression, in a new form created in the sample Northwind
database, and it works fine for me. I started by copying the Employees table,
with data, to "tblEmployees". Then I renamed the BirthDate field to
DateOfBirth (no spaces). I created the form, and added an extra text box
"Date Of Birth" with your expression as the control source.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
F

forest8

Hi

The Name Autocorrect Options have Track Name Autocorrect Info and Peform
name AutoCorrect are checked (i.e. on).

I was able to get the formula to stick but it still has a #Name? error.

I just don't get it.

Thanks.

Tom Wickerath said:
Do you have Name Autocorrect (aka Name Autocorrupt) enabled?
I just tried your expression, in a new form created in the sample Northwind
database, and it works fine for me. I started by copying the Employees table,
with data, to "tblEmployees". Then I renamed the BirthDate field to
DateOfBirth (no spaces). I created the form, and added an extra text box
"Date Of Birth" with your expression as the control source.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

forest8 said:
The Text box is called [Date of BIrth] (with spaces bewtween the words.
 
J

John W. Vinson

Hi

The Name Autocorrect Options have Track Name Autocorrect Info and Peform
name AutoCorrect are checked (i.e. on).

That's probably the problem!

It's buggy. Tom called it "Name Autocorrupt" - and that's unfortunately an apt
nickname. It can remember old deleted names and they can come back like
zombies.

Try turning Track Name Autocorrect *off*; compact and repair the database; and
rename/doublecheck the names of the controls.
 

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

Similar Threads


Top