>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
[quoted text clipped - 4 lines]
>
>Thanks in advance!
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
> >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
[quoted text clipped - 19 lines]
>
> John W. Vinson[MVP]
John Vinson - 10 Jan 2005 00:10 GMT
>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
[quoted text clipped - 3 lines]
>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]
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: scollins@labsatbonfils.com
home: oldstonebuddha@comcast.net
> >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
[quoted text clipped - 19 lines]
>
> John W. Vinson[MVP]