#Name? Problem

Greyowlsl

Mlak Mlak
Local time
Today, 18:46
Joined
Oct 4, 2006
Messages
204
Hi,

I have looked up the #Name? problem on other sites, but it has not helped.

Attached is a screen of a form with its control source (Query).
The controls on the form are linked simply to fields on in the query, with no spelling mistakes, and no extra calculations.
As you can see the query runs fine in datasheet view.
The query contains count and sum operations, as well as some simple criteria such as '<>0', 'is not null' etc.
The only thing i can think of is a datatype problem, but textbox's are string based not integer right?.. so 50k+ should be able to be entered.

Thanks for your time.
Kind Regards,
Leon
 

Attachments

  • temp5.jpg
    temp5.jpg
    29.6 KB · Views: 121
Hmmm... I don't see any problems there.

So the field name is exactly as what is in the query? Did you select it from the drop down in the Control Source or did you type it in?

Are you using linked tables?
 
Text box can show any kind of data (A True/False will be seeing as -1/0)

#Name do indicate either a wrong name. It can also be caused by having the same field name on more then one table in the query.

As vbaInet suggested make sure it can be picked from the drop down list.
Try to look at the data source query and see what you get there.
 
Normally, the #Name problem is that you have a control on the form that is named the same as one of the fields that you are using in a formula. Rename the text box to txtWhateverTheOriginalNameWas and then make sure your formula is referring to the FIELD name and not the text box name.
 
Hi guys,

Thanks for your replies.
The controlsources were selected from the dropdown.
I removed the changed field names in the query and then the form works fine.
But this is annoying as the combobox shows fields that are hard to understand, unless they're renamed.
What does this mean and what can i do?

Kind Regards,
Leon
 
Attached is a screen of what it all looks like when it works.

For the combobox, could i use
Code:
Private Sub Form_Open(Cancel As Integer)
Dim powerboard as string
powerboard = "sumoffault_powerboard"
End Sub
for each field, and then
Code:
Private Sub Combo8_AfterUpdate()
Me.Text10.ControlSource = Me.Combo8
End Sub
Just thought there was an easier way.
 

Attachments

  • temp6.jpg
    temp6.jpg
    62.7 KB · Views: 107
You Could use an Alius on the field that is more appropriate.

attachment.php



attachment.php
 

Attachments

  • Image1.PNG
    Image1.PNG
    16.2 KB · Views: 206
  • Image2.PNG
    Image2.PNG
    9.5 KB · Views: 192
Those field names are aliases automatically created by Access. So what John Big Booty is implying is you can rename those aliases to your taste.
 
Thanks guys, i see what you mean, but this is exactly the problem I'm having, i had aliases at the start but that's what brought up the #Name? issue.

I just tried something which strangely worked.
I made an alias for a field (Alias: REPAIR_DATE), but left the text box control source as SumOfREPAIR_DATE, and for some reason it shows the data. Unfortunately this doesn't help the fact that ill still need to put these (eg. sumoffault_powerboard) in the selections for the combo box, whether the query fields are aliased or not.
 
The alias can't be an existing field name.


what this part of the code is for ?
what "for each field" mean ?
For the combobox, could i use
Code:
Private Sub Form_Open(Cancel As Integer)
Dim powerboard as string
powerboard = "sumoffault_powerboard"
End Sub
for each field
 
@Greyowlsl: I don't understand why you have a combo box that lists field names.

Could you upload a db showing us the problem (before the workaround).
 
I just tried the alias thing again and this time it all worked, no #name?. Not sure why it worked, restarting access didn't do anything last time. Maybe because its access 97 -.-. Thanks for all you help though guys.

Kind Regards,
Leon

PS: attached is an example of what i was trying to do.
 

Attachments

Ah, 97. There's no point of me trying then because I would have to save your db as a post 97 version and it won't make sense trying it out on that.

I thought you would have upgraded by now ;)
 

Users who are viewing this thread

Back
Top Bottom