UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Unbound calculation    
 
   
Jack210
post Jun 9 2008, 07:04 AM
Post #1

UtterAccess Addict
Posts: 119



Hello...
I have managed to link my unbound list box to a query, that calculates the average time a particular process takes. (Users only view this data)
I tried linking it to a combo box, but you have to click on the drop down to see the calculation, and a text box has no row source..also is it possible to format the value in the list box, for example if its greater the 30 mins then the font will be red..I was unable to get conditional formatting to work on a list box..

thanks
Jack
Go to the top of the page
 
+
Alan_G
post Jun 9 2008, 07:09 AM
Post #2

Utterly Yorkshire and Forum/Wiki Editor
Posts: 15,895
From: Devon UK



So you're query only returns one result and you're wanting to show that result and not a list ?

You can do that by putting an unbound textbox on your form, and in the Control Source put

=DLookup("NameOfQueryField","NameOfYourSavedQuery")

Conditional Fromatting will then work fine on the textbox
Go to the top of the page
 
+
Jack210
post Jun 9 2008, 08:25 AM
Post #3

UtterAccess Addict
Posts: 119



Hi Alan,
Thanks for your reply, I have tried this and get an error - #Error

=DLookUp("Time Taken","Qry_Updated Average 1"), this is what I have typed in the control..

I used this query to calculate the average of five numbers, from a larger query, and created my own field name
called Time Taken. (see attachment)...any ideas why its not working...

thanks

Paul
Attached File(s)
Attached File  query2.jpg ( 274.81K ) Number of downloads: 2
 
Go to the top of the page
 
+
Alan_G
post Jun 9 2008, 08:33 AM
Post #4

Utterly Yorkshire and Forum/Wiki Editor
Posts: 15,895
From: Devon UK



Hi Jack/Paul

As you're using spaces in your naming (never a good idea in Access!!), you'll need to change it to

=DLookUp("[Time Taken]","[Qry_Updated Average 1]")

You may also want to check there's a result as well, and if not diplay 0 like this

CODE
=Nz(DLookUp("[Time Taken]","[Qry_Updated Average 1]"),0)
Go to the top of the page
 
+
Jack210
post Jun 9 2008, 08:53 AM
Post #5

UtterAccess Addict
Posts: 119



Thanks very much.. it works !!!!..you saved me alot of time...

Jack/Paul
Go to the top of the page
 
+
Alan_G
post Jun 9 2008, 09:06 AM
Post #6

Utterly Yorkshire and Forum/Wiki Editor
Posts: 15,895
From: Devon UK



No problem....glad you got it working (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 04:06 AM