473,804 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem using query to supply Default Value for textfield

I want a textfield on a form to show the result of a query (see below). Using the expression builder, I set Default Value to:

=[qrySumPaymentsF orDonation]![totalPayments]

But when I try the form, it comes up #Name?

What am I doing wrong?

Thanks!

Here's the qrySumPaymentsF orDonation:

SELECT SUM(Payments.am ount) AS totalPayments
FROM Payments
WHERE Payments.donati onID=Forms!Dona tions!id;
Nov 12 '05 #1
1 5791
You cannot use a Query as the Default Value. Consider using the Domain
Aggregate Function "DLookup" instead.

Larry Linson
Microsoft Access MVP

"Phil M" <sz************ @yahoo.com> wrote in message
news:11******** *****@news.rcn. com...
I want a textfield on a form to show the result of a query (see below). Using the expression builder, I set Default Value to:
=[qrySumPaymentsF orDonation]![totalPayments]

But when I try the form, it comes up #Name?

What am I doing wrong?

Thanks!

Here's the qrySumPaymentsF orDonation:

SELECT SUM(Payments.am ount) AS totalPayments
FROM Payments
WHERE Payments.donati onID=Forms!Dona tions!id;

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6439
by: Veverita | last post by:
Hi there I'm hoping that someone can help me with a question I have about javascript syntax. I got an html page that uploads an image and some text field to a database. What I'd like to do is modify the content of one of the textfields prior to it being submitted to the database. Specifically, I need to
9
2034
by: | last post by:
hi everyone, i was hoping someone could help me. the code below - in IE the menu options (text) are a couple of pixels too low and i cant move them up, and the form boxes are ok. in mozilla the reverse is true - the text links are ok but the form boxes are too low! I cant figure out why this is happening. I want the text to be vertically centered in the black menu bar, and the form boxes likewise. any help greatly appreciated!
6
1894
by: John Baker | last post by:
HI: I have a situation where I wish to enter a value in an unbound field on a form and then change the same field in each record on the form so that it reflects the value entered. THe form is suppored by an updatable query (linked to a table). I would rather not use a query approach because it will result in a need for a new form and will create its own complications (although this could be done) I would like to make the change so that it...
0
1152
by: er1 | last post by:
Hi All, I am trying populate dropdownlist using SQL query. I am able to bind the list and populate it with query result. But in Dropdown list it shows 1st result of a query as a default value. I want to show a default value such as **select customer**. I am able to add this value in first page but having problem when running it. I am using Visual Web Developer ,C#.NET and SQL Server 2000. Dropdown list has textfield as...
4
2088
by: Regnab | last post by:
I've got a form - "frmLookup" (with a subform) that works very happily on its own. The form has a list box, which when updated requeries the subform to display the appropriate results. The problem is that for the final user interface, I had planned to use a "frmDisplay" form which had a number of menu items and then depending on what the user selected, it would display the appropraite form in a subform beneath the menu items. I did this...
7
1295
by: David | last post by:
Hi, using C# asp.net 1.1 I am having a problem. If I use the code below, but have null passed as the PostingGuid, then by the time I get to fill the dataset, I have "an object is not set to an instance of an object". This then totally knocks out any connection to my database for the rest of my application until I terminate the aspnet process.
3
2883
by: Andrew | last post by:
Hi All I wonder if anyone can help me with this. The scenario is that I have a pair of related tables. One contains record labels, the other contains contact names at those labels. In the contacts table there is a boolean field called blnLabelDefault which identifies whether the listed contact should be used as the default for a label. There is code to ensure that no more than one
3
1356
by: pradeep84 | last post by:
hi.. to all.. i executed the following program.. i entered the data in the output screen..but the data is not updated in the database.... Is there any problem with the program.. plz help me........ import java.applet.*; import java.awt.*; import java.sql.*; import java.awt.event.*; import sun.jdbc.odbc.*; public class Customerdetails extends Frame implements ActionListener
1
1944
by: macintoshhondo | last post by:
Hi ! i am a newbie and dont know javascript much. what i really need is a simple javascript code that can insert number in the value section of the different forms from the one form. FORM 1: <form> <input type="text" name="textField" size="20"><br> </form> In the "TextField " of Form 1 i type any number and let the number be 100. Now what i really want is that in Form 2 : Textfield should be 100 that is just like that of form 1. In...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6846
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.