A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Name? displayed in a text box (Access 2003)



 
 
Thread Tools Display Modes
  #1  
Old January 8th, 2005, 06:57 PM
OldStoneBuddha
external usenet poster
 
Posts: n/a
Default #Name? displayed in a text box (Access 2003)

I have an error that is driving me nuts...
I have an unbound form in which I want to display the results of a query in
a textbox. The query evaluates correctly, but the textbox displays #Name?
instead of the value from the query. What is going on?

I apologize if this seems a silly question as I am a learning Access.

Thanks in advance!
  #2  
Old January 8th, 2005, 07:04 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Sat, 8 Jan 2005 10:57:01 -0800, OldStoneBuddha wrote:

I have an error that is driving me nuts...
I have an unbound form in which I want to display the results of a query in
a textbox. The query evaluates correctly, but the textbox displays #Name?
instead of the value from the query. What is going on?

I apologize if this seems a silly question as I am a learning Access.

Thanks in advance!


And the actual control source of the unbound text box is ....?
And the name of the unbound text box is ....?
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old January 8th, 2005, 09:34 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Sat, 8 Jan 2005 10:57:01 -0800, "OldStoneBuddha"
wrote:

I have an error that is driving me nuts...
I have an unbound form in which I want to display the results of a query in
a textbox. The query evaluates correctly, but the textbox displays #Name?
instead of the value from the query. What is going on?

I apologize if this seems a silly question as I am a learning Access.

Thanks in advance!


The Control Source property of the textbox should be EITHER the name
of a field in the Form's Recordsource query; OR an expression in its
own right, preceded by an equals sign, e.g.

=[ThisField] + [ThatField];

OR a Domain Function call to look up the value from a query:

=DLookUp("[ResultField]", "[QueryName]", "optional criteria string")

My guess is that you're just putting the name of the query, or
queryname.fieldname, in the control source: that will NOT work.

John W. Vinson[MVP]
  #4  
Old January 8th, 2005, 10:05 PM
OldStoneBuddha
external usenet poster
 
Posts: n/a
Default

You hit the nail on the head. I was using the queryname.fieldname in the
control source. I will try the dlookup function. The problem I'm trying to
solve is a wierd one, you can read on if your intrested...

I'm sure there is a more elegant way to do this, but here goes...
What I'm trying to do is display multiple records on one form. I'm easily
able to do that by setting a form's (bound to a query) default view to
Continuous Forms. The problem is that in the query results I'm trying to
display, I need to show the records in a custom sort order. The records
returned from the query have three primary keys, TrayName(text),
ColNumber(integer), and
RowNumber(integer). When I display the records for a particular TrayName, I
need them sorted by the ColNumber, then the RowNumber. The tricky part is
that on odd number rows, the columns must be sorted Ascending (1-6) and on
even rows the columns must be sorted decending (6-1). (This is the way users
will enter data, and is based on how the users generate the readings from a
microscope tray. It's called serpentine reading.) I can't figure a way to
do this in reports or forms with the built in Access sort orders, so...

To get around this problem, I tried creating an unbound form, and dropping
individual textboxes on it. Then I generated unique queries for each well on
the tray (96 of them) and tried to link the Record Source property for each
textbox to the appropriate query. The queries work fine, but the text boxes
on the form just display "#Name?".

For example: the textbox (Text2) that is supposed to display Row1, Column1
for the selected tray has the following query as its control source:
=Trayr1c1!ABOCtr. That query looks like this: SELECT [Prelim 180
Query].CellTxt, [Prelim 180 Query].ABOCtr
FROM [Prelim 180 Query]
WHERE ((([Prelim 180 Query].TrayNm)=[Forms]![Navigator]![TraySelect]) AND
(([Prelim 180 Query].RowNbr)=1) AND (([Prelim 180 Query].ColNbr)=1));

I've been trying to figure this out for DAYS...any suggestions would be
greatly appreciated.

Peace,
OldStoneBuddha


"John Vinson" wrote:

On Sat, 8 Jan 2005 10:57:01 -0800, "OldStoneBuddha"
wrote:

I have an error that is driving me nuts...
I have an unbound form in which I want to display the results of a query in
a textbox. The query evaluates correctly, but the textbox displays #Name?
instead of the value from the query. What is going on?

I apologize if this seems a silly question as I am a learning Access.

Thanks in advance!


The Control Source property of the textbox should be EITHER the name
of a field in the Form's Recordsource query; OR an expression in its
own right, preceded by an equals sign, e.g.

=[ThisField] + [ThatField];

OR a Domain Function call to look up the value from a query:

=DLookUp("[ResultField]", "[QueryName]", "optional criteria string")

My guess is that you're just putting the name of the query, or
queryname.fieldname, in the control source: that will NOT work.

John W. Vinson[MVP]

  #5  
Old January 8th, 2005, 10:37 PM
OldStoneBuddha
external usenet poster
 
Posts: n/a
Default

edMr. Vinson,

THANK YOU!!! That solved it. I put the following in my control source:
=DLookUp("[CellTxt]","[Prelim 180 Query]","[RowNbr] = 1 AND [ColNbr] =1")
and viola! You have helped me a great deal, and you have my gratitude. My
problem is that I am a old EXCEL user & VB person who is now realizing the
great benefits of ACCESS. However, some skills don't port over well to
ACCESS. In VB, I could just set the textbox field's Value property to
whatever I wanted. ACCESS has some stricter rules...but I will learn.
Again, Thank You!

Peace,

Scott D. Collins, CHS(ABHI)
Laboratories At Bonfils
Denver, CO
work:
home:


"John Vinson" wrote:

On Sat, 8 Jan 2005 10:57:01 -0800, "OldStoneBuddha"
wrote:

I have an error that is driving me nuts...
I have an unbound form in which I want to display the results of a query in
a textbox. The query evaluates correctly, but the textbox displays #Name?
instead of the value from the query. What is going on?

I apologize if this seems a silly question as I am a learning Access.

Thanks in advance!


The Control Source property of the textbox should be EITHER the name
of a field in the Form's Recordsource query; OR an expression in its
own right, preceded by an equals sign, e.g.

=[ThisField] + [ThatField];

OR a Domain Function call to look up the value from a query:

=DLookUp("[ResultField]", "[QueryName]", "optional criteria string")

My guess is that you're just putting the name of the query, or
queryname.fieldname, in the control source: that will NOT work.

John W. Vinson[MVP]

  #6  
Old January 10th, 2005, 12:10 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Sat, 8 Jan 2005 14:05:02 -0800, "OldStoneBuddha"
wrote:

The records
returned from the query have three primary keys, TrayName(text),
ColNumber(integer), and RowNumber(integer).


Jargon nitpick: you have ONE Primary Key consisting of three fields.
The primary key is by definition unique - Highlander.There Can Only
Be One/Highlander

When I display the records for a particular TrayName, I
need them sorted by the ColNumber, then the RowNumber. The tricky part is
that on odd number rows, the columns must be sorted Ascending (1-6) and on
even rows the columns must be sorted decending (6-1). (This is the way users
will enter data, and is based on how the users generate the readings from a
microscope tray. It's called serpentine reading.) I can't figure a way to
do this in reports or forms with the built in Access sort orders, so...


Ok... put a calculated field in the Query:

SortCol: IIf([RowNumber] MOD 2 = 0, 7 - [ColNumber], [ColNumber])

and sort by TrayName, SortCol, and RowNumber.

Glad to be able to help!

John W. Vinson[MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2000 reports not printing in Access 2003 Heinz Thorwald Setting Up & Running Reports 5 August 9th, 2005 05:00 PM
Running an .mde created by Access 2003 on a computer with Access 2 Aaron New Users 0 November 22nd, 2004 03:15 PM
Using Access 2003 UPGRADE to upgrade Access 97 Tabby General Discussion 5 October 26th, 2004 02:21 PM
Access XP Compared to Access 2003 Mardene Leahu New Users 1 October 1st, 2004 05:11 AM
Productkey problem when installing office 2003 on network Stefan Schreurs Setup, Installing & Configuration 1 June 1st, 2004 11:16 PM


All times are GMT +1. The time now is 08:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.