473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MS access form issue

7 New Member
I am using Access 2003. I am trying to bring a calculated value from a query to a form. I would like to have the query bring the value back to the form as read only.

Help!
Feb 22 '08 #1
13 1886
Scott Price
1,384 Recognized Expert Top Contributor
You can 'bind' a text box to this query field just as normal, then in the properties for the text box, set Enabled to No and Locked to Yes. Your users will be able to view the data in the text box but not change it.

Regards,
Scott
Feb 22 '08 #2
likemike973
7 New Member
Forgive me for being a newb, how do you bind? I tried searching online and vb stuff is beyond me. Is there a way thru expression builder or the properties to do it?

Thanks Again,
Mike
Feb 23 '08 #3
Scott Price
1,384 Recognized Expert Top Contributor
A control is said to be 'bound' when it's Control Source (in form design view, double click the control, or right click and select properties>All tab) is set to a field in a table or query. On this same tab you will find the Enabled and Locked properties that I referred to also.

The same control will show to be 'Unbound' in form design view if it's Control Source is set to nothing.

Regards,
Scott
Feb 23 '08 #4
likemike973
7 New Member
OK now I understand bound and unbound, I have actually been doing it just did not know the term. Thanks.

I created a Text Box and tied it to a control. In this case =(qrynetprofit![Net Profit]), and when I go to the form view it show #NAME? error in the field where the Net Profit value should be. Have you seen this before?

Thanks
Mike
Feb 23 '08 #5
Scott Price
1,384 Recognized Expert Top Contributor
Is this field part of the Record Source for your form? If you are attempting to pull this from one table or query while the rest of the form is based on a separate query or table you'll have this problem.

In this case you'll need to include this value in the Record Source for the form, by creating a separate query that includes it.

Otherwise, it's likely from a calculated value that isn't being calculated yet.

Regards,
Scott
Feb 23 '08 #6
likemike973
7 New Member
Thanks for the help so far. I have attempted a few things on my own. The information is coming from the Record Source, but like you stated it hasn't calculated the fields yet. Is there a way to make it calculate, by refreshing? or maybe using another query to calculate.

Thanks for the help so far.

Mike
Mar 1 '08 #7
Scott Price
1,384 Recognized Expert Top Contributor
The #Name? error will come if the field you are attempting to bind the control to is not in the query/record source for the form, in other words, it doesn't have a valid control source...

Otherwise it will show #Error, when the calculation hasn't been performed yet or can't be performed for some reason.

When looking at the form in design view, is there is a small green triangle covering the upper-left corner of the text box?

If so, the problem is likely because the control source is not, in fact, part of the record source for the form, either because it's from another query, or because the control source is mis-spelled.

Are you sure that it's the #Name? error showing?

Regards,
Scott
Mar 1 '08 #8
Scott Price
1,384 Recognized Expert Top Contributor
Just looking at your earlier post again. You show the control source to be =[FieldName]. Delete the equal sign and try again.

The = sign tells Access that you are calculating within the text box itself. To do a simple binding to a query field, the = sign is not needed.

Regards,
Scott
Mar 1 '08 #9
likemike973
7 New Member
I checked out the small green block, and yes you are correct, like you stated before I am using the wrong source. My form is putting information into a table, tbl1 and I need one piece of calculated information from a query, qryprofit, to go back to the form to display a calculated value. Is there a way to get the one piece of information from the query back onto the form while maintaining the integrity of the form based on tbl1?

I made a input form to help me calculate fees, etc on Ebay for myself and a friend. It has been challenging but also rewarding. I enjoy, most of the time, these problems. I would ultimately like to input on the form a list of fees, and costs associated with a particular product and have at the bottom the form give the Net Profit from the query.

Yes the error is #NAME?

Thanks
Mar 1 '08 #10
Scott Price
1,384 Recognized Expert Top Contributor
Not being able to see your database, I'm not able to say which is the better way to go, but you have two options:

First option is to include your base table in the query you are using to calculate the information. This is probably the best option. Just right click on the query in design view and choose 'Show Table', choose the table you are putting the information into, and then save the query and run it to make sure that all the required records show up.

You'll then have to go back to the form in design view, change it's record source from the table to the query and re-bind each control on the form to the corresponding field passed through from the query.

Second is to do the calculation in the text box itself instead of the query. This would involve using the = sign and whatever calculation you have, i.e. =DSum() etc. etc.

There isn't a great deal of difference between the two options in terms of performance, but the first is likely just a bit faster in displaying the calculated value in the text box.

Remember to make a backup copy of your query before changing it! Then if something goes wrong and you can't figure out how to fix it, you can just revert to the backup!

Regards,
Scott
Mar 1 '08 #11
likemike973
7 New Member
I'll give it a try.

Thanks again
Mike
Mar 1 '08 #12
likemike973
7 New Member
I tried the first option. It works great! I will have to rebuild the form, but that is part of the learning curve.

Thanks for all the help,
Mike
Mar 1 '08 #13
Scott Price
1,384 Recognized Expert Top Contributor
Not a problem, and glad you got it figured out!

Thanks for posting back letting us know that it worked.

Regards,
Scott
Mar 1 '08 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
20
by: Allen Browne | last post by:
To help you avoid some of the more common and long-standing bugs in Access, the page: http://allenbrowne.com/tips.html contains a new section entitled, "Flaws in Access". The section currently...
3
by: pbbriggs | last post by:
I will try to be as descriptive as possible, but this error has me stumped and I am not sure what relevant info to include.... I am running Access XP on a Windows XP machine. I initially began...
9
by: MacDermott | last post by:
I have an Access MDB which instantiates a class in a custom DLL, manipulates it for a while, then sets it equal nothing. The MDB does other things,too, and generally behaves itself as desired....
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
7
by: Kenneth_J | last post by:
Hey everyone, I just started doin some work with access and vba, and don't know much about it yet...any help would be much appreciated. My goal is to create a form in word that can be filled...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
9
by: Sam Lambson | last post by:
Hi, This is similar to another post, because I still haven't gotten to the bottom of it. I have a back end database on a shared drive. Each (of 4) user has a front end file on their own C:...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.