#Name? Error

  • Thread starter Thread starter Todd Wilson
  • Start date Start date
T

Todd Wilson

I read the other post in this newsgroup regarding this error, and I do not
believe that that persons problem is applicable.

I have created a linked database on my development computer. Everything
works fine. My wife tests my software, so I copied both .mdb files to her
laptop. We opened the main file and linked it to the data file. Life is
good. We then opened a form referencing one of the main tables and I
received this in error in a text box at the top of the form. Here is the
code...

The control source is...='Employee ID: ' & Format([EmployeeID],"00000")

Funny thing is that one inch further down on the form I again display the
employee id in a text box with the control source set to: EmployeeID

This time it works fine and displays the EmployeeID.

So, since it works on one machine and doesn't work on another, something
must be missing on the laptop. I went to Tools-References and looked for
missing references - there are none. What do I check next?

Also, I am getting this error on another form that references another main
table. Again, same setup, I have a header section at the top of the form
with a Room Number in bold, then down in the data entry area of the form I
have a text box that displays the room number. I am getting the same #Name?
error at the top of the form, but not at the bottom.

Any thoughts?

Thanks,

Todd
 
OK, I did some more digging and found that whenever I used the Format
command, whether it be on a form or a report, I get this error. What am I
missing here? I did not create a build for this app., I just copied the
data files, so maybe using Developer would clear this up. But can I fix it
manually?

Thanks,

Todd
 
This error usually is caused by having a control named EmployeeID on the
form but that control is not bound to the field named EmployeeID in the
form's recordset. When you drag a field from the field list onto the form,
ACCESS will create a textbox for you and name the textbox the same as the
field. However, if you then delete that field from that control's
ControlSource and bind that field to a different control, ACCESS doesn't
know which one to use in your expression with the Format expression. You'll
need to change the control name from EmployeeID to txtEmployeeID or
something else.

Also, I would change your expression to this:
="Employee ID: " & Format([EmployeeID],"00000")
 
Ken,

I appreciate the response, but I don't believe that you've addressed the
problem.

This form works on one machine - perfectly. It does not work on two other
machines.

What this seems to tell me is that on my development machine I have changed
something in the operating system that responds differently to the format
function on the other machines. My question is what is that change and how
can I fix it?

In response to your message, the name of the control is not EmployeeID, it
was changed to lblEmployeeID. I did change the ' to " as per your
suggestion, to no avail.

Thanks,
Todd

Ken Snell said:
This error usually is caused by having a control named EmployeeID on the
form but that control is not bound to the field named EmployeeID in the
form's recordset. When you drag a field from the field list onto the form,
ACCESS will create a textbox for you and name the textbox the same as the
field. However, if you then delete that field from that control's
ControlSource and bind that field to a different control, ACCESS doesn't
know which one to use in your expression with the Format expression. You'll
need to change the control name from EmployeeID to txtEmployeeID or
something else.

Also, I would change your expression to this:
="Employee ID: " & Format([EmployeeID],"00000")
--

Ken Snell
<MS ACCESS MVP>

Todd Wilson said:
I read the other post in this newsgroup regarding this error, and I do not
believe that that persons problem is applicable.

I have created a linked database on my development computer. Everything
works fine. My wife tests my software, so I copied both .mdb files to her
laptop. We opened the main file and linked it to the data file. Life is
good. We then opened a form referencing one of the main tables and I
received this in error in a text box at the top of the form. Here is the
code...

The control source is...='Employee ID: ' & Format([EmployeeID],"00000")

Funny thing is that one inch further down on the form I again display the
employee id in a text box with the control source set to: EmployeeID

This time it works fine and displays the EmployeeID.

So, since it works on one machine and doesn't work on another, something
must be missing on the laptop. I went to Tools-References and looked for
missing references - there are none. What do I check next?

Also, I am getting this error on another form that references another main
table. Again, same setup, I have a header section at the top of the form
with a Room Number in bold, then down in the data entry area of the form I
have a text box that displays the room number. I am getting the same #Name?
error at the top of the form, but not at the bottom.

Any thoughts?

Thanks,

Todd
 
Todd Wilson said:
OK, I did some more digging and found that whenever I used the Format
command, whether it be on a form or a report, I get this error. What
am I missing here? I did not create a build for this app., I just
copied the data files, so maybe using Developer would clear this up.
But can I fix it manually?

Often when databases don't work on one particular machine, it's because
of a broken or missing reference. See if the steps outlined here help:


http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 
Dirk,

Thank you - That is just what I needed. I'll work through the steps and
post back to the group what I found.

Sincerely,
Todd
 
Then Dirk's suggestion regarding the references is the next step to test.
--

Ken Snell
<MS ACCESS MVP>

Todd Wilson said:
Ken,

I appreciate the response, but I don't believe that you've addressed the
problem.

This form works on one machine - perfectly. It does not work on two other
machines.

What this seems to tell me is that on my development machine I have changed
something in the operating system that responds differently to the format
function on the other machines. My question is what is that change and how
can I fix it?

In response to your message, the name of the control is not EmployeeID, it
was changed to lblEmployeeID. I did change the ' to " as per your
suggestion, to no avail.

Thanks,
Todd

Ken Snell said:
This error usually is caused by having a control named EmployeeID on the
form but that control is not bound to the field named EmployeeID in the
form's recordset. When you drag a field from the field list onto the form,
ACCESS will create a textbox for you and name the textbox the same as the
field. However, if you then delete that field from that control's
ControlSource and bind that field to a different control, ACCESS doesn't
know which one to use in your expression with the Format expression. You'll
need to change the control name from EmployeeID to txtEmployeeID or
something else.

Also, I would change your expression to this:
="Employee ID: " & Format([EmployeeID],"00000")
--

Ken Snell
<MS ACCESS MVP>

Todd Wilson said:
I read the other post in this newsgroup regarding this error, and I do not
believe that that persons problem is applicable.

I have created a linked database on my development computer. Everything
works fine. My wife tests my software, so I copied both .mdb files to her
laptop. We opened the main file and linked it to the data file. Life is
good. We then opened a form referencing one of the main tables and I
received this in error in a text box at the top of the form. Here is the
code...

The control source is...='Employee ID: ' & Format([EmployeeID],"00000")

Funny thing is that one inch further down on the form I again display the
employee id in a text box with the control source set to: EmployeeID

This time it works fine and displays the EmployeeID.

So, since it works on one machine and doesn't work on another, something
must be missing on the laptop. I went to Tools-References and looked for
missing references - there are none. What do I check next?

Also, I am getting this error on another form that references another main
table. Again, same setup, I have a header section at the top of the form
with a Room Number in bold, then down in the data entry area of the
form
 
Dirk,

I began with refreshing the references, as specified in Q194374 - ACC97:
Error Message: Function Isn't Available in Expressions in Query Expression
(and referenced on your excellent web page) which I found on Microsoft's
site. This did not seem to work at the time. But this morning the
application started working properly on my wife's laptop. Weird. So I
retraced my step's and found that I had properly followed the refreshing
steps, but had not restarted Access before seeing if the format function
worked. So I found another computer and installed my application - same
#Name? problem. I checked, exited, then unchecked and exited the References
section, then restarted Access. Bingo!

So, I would insert a new step 7 in the procedure outlined in Q194374...

You can use Microsoft Access to refresh the references on a target computer
manually. To do so, follow these steps:
1. Open the database that causes the errors mentioned in the "Symptoms"
section.
2. On the Modules tab, click New.
3. On the Tools menu, click References.
4. In the References dialog box, pick any single reference that is not
already selected, click to select it, note which one you selected, and then
click OK.
5. On the Tools menu, click References again.
6. Click to clear the reference that you selected in step 4, and then click
OK.
7. Restart Access
8. Run the query, the form, or the report on which you saw the errors
mentioned in the "Symptoms" section. No errors occur.

Thanks again for your help. You confirmed that I was on the right track and
provided valuable reference materials.

Sincerely,

Todd Wilson
 
Todd Wilson said:
Dirk,

I began with refreshing the references, as specified in Q194374 -
ACC97: Error Message: Function Isn't Available in Expressions in
Query Expression (and referenced on your excellent web page)

Not my page, Doug Steele's. It's pretty comprehensive, isn't it?

which I
found on Microsoft's site. This did not seem to work at the time.
But this morning the application started working properly on my
wife's laptop. Weird. So I retraced my step's and found that I had
properly followed the refreshing steps, but had not restarted Access
before seeing if the format function worked. So I found another
computer and installed my application - same #Name? problem. I
checked, exited, then unchecked and exited the References section,
then restarted Access. Bingo!

So, I would insert a new step 7 in the procedure outlined in
Q194374...

You can use Microsoft Access to refresh the references on a target
computer manually. To do so, follow these steps:
1. Open the database that causes the errors mentioned in the
"Symptoms" section.
2. On the Modules tab, click New.
3. On the Tools menu, click References.
4. In the References dialog box, pick any single reference that is not
already selected, click to select it, note which one you selected,
and then click OK.
5. On the Tools menu, click References again.
6. Click to clear the reference that you selected in step 4, and then
click OK.
7. Restart Access
8. Run the query, the form, or the report on which you saw the errors
mentioned in the "Symptoms" section. No errors occur.

Huh. I wouldn't have thought you needed to exit Access and come back
in. You would naturally have to close and reopen whatever object was
showing the error. But if you had to restart Access, I'll note that for
future advice.
 
Dirk,

I began with refreshing the references, as specified in Q194374 - ACC97:
Error Message: Function Isn't Available in Expressions in Query Expression
(and referenced on your excellent web page) which I found on Microsoft's
site. This did not seem to work at the time. But this morning the
application started working properly on my wife's laptop. Weird. So I
retraced my step's and found that I had properly followed the refreshing
steps, but had not restarted Access before seeing if the format function
worked. So I found another computer and installed my application - same
#Name? problem. I checked, exited, then unchecked and exited the References
section, then restarted Access. Bingo!

So, I would insert a new step 7 in the procedure outlined in Q194374...

You can use Microsoft Access to refresh the references on a target computer
manually. To do so, follow these steps:
1. Open the database that causes the errors mentioned in the "Symptoms"
section.
2. On the Modules tab, click New.
3. On the Tools menu, click References.
4. In the References dialog box, pick any single reference that is not
already selected, click to select it, note which one you selected, and then
click OK.
5. On the Tools menu, click References again.
6. Click to clear the reference that you selected in step 4, and then click
OK.
7. Restart Access
8. Run the query, the form, or the report on which you saw the errors
mentioned in the "Symptoms" section. No errors occur.

Thanks again for your help. You confirmed that I was on the right track and
provided valuable reference materials.

Sincerely,

Todd Wilson
 
Back
Top