View Full Version : Solved: query - textbox
eran3185
05-20-2007, 12:29 PM
i have a form.
i made a query , and i can see the query only in a subform , but i want to see the query in a simple textbox.
how can i do this thing ?
geekgirlau
05-20-2007, 08:29 PM
What do you mean "see the query"? Do you mean the results of the query? How many fields does the query display?
eran3185
05-20-2007, 10:20 PM
hey
yes , i mean the results of the query.
there are 2 fields , and i want to see one of them
geekgirlau
05-21-2007, 12:29 AM
If your query contains a single record, you can set the control source of your text box as the following:
=DLookup("[MyField]","MyQuery")
eran3185
05-21-2007, 09:53 PM
hey
its work almost perfect.
can u see the att file ?
when we go from the first deal to the second , the upper left text box still "200" (instead 30) :(
geekgirlau
05-21-2007, 11:25 PM
In the On Current event for the form, requery the text box.
eran3185
05-22-2007, 12:38 AM
i'm fresh with access
what u mean in your answer ?
geekgirlau
05-22-2007, 05:00 AM
Open the form in design mode
Select View | Properties
Make sure at the top of the Properties box the title is "Form"
Click on the Event tab
Click on the arrow to the right of "On Current" and select "[Event Procedure]"
Click on the button to the right of "On Current" with the ellipsis (...)
Enter "Me.MyTextBox.Requery" - change MyTextBox to the name of your text box containing the calculation
eran3185
05-22-2007, 06:09 AM
hey
first of all - thanks !!!!!
i did exactly what u wrote , but
it's not work :dunno
u can see it in the att file
eran3185
05-22-2007, 06:12 AM
:doh:
geekgirlau
05-24-2007, 01:13 AM
Your query generates 2 records, so you need a way to determine which record you are trying to display.
Are either of the fields in the query related to the main form data in any way? You may be able to do this as a subform with one visible control instead of DLookup.
eran3185
05-24-2007, 06:58 AM
it's work !!!
but ...
now i want a report
and i want that the text-box will be there
now i have new problem ...
geekgirlau
05-24-2007, 07:03 PM
You should be able to copy the text box from your form, and paste it directly into the report to get the same result.
eran3185
05-25-2007, 12:46 AM
for some reason - i can't
and i dont know why
geekgirlau
05-27-2007, 06:11 PM
What about creating a text box in your report, then using exactly the same formula as you had in your form?
eran3185
05-27-2007, 10:07 PM
thanks
itws work ok
:clap:
geekgirlau
05-27-2007, 11:07 PM
That's great!
Don't forget to mark this thread as "Solved" - go to "Thread Tools" at the top of the page, and select "Mark thread solved".
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.