473,657 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"#Error" in an Unbound Text box - Continuous form

kcdoell
230 New Member
Hello:

I three fields on a continuous form:
[GWP], [NWP] & [Binding_Percent age]

On the same form I have an unbound text box [Sum50NWP] with the following formula in the control source:

Expand|Select|Wrap|Line Numbers
  1.  =Sum(IIf([Binding_Percentage]=50,[NWP],0)) 
This worked great.

Now I am being requested that my user does not want an End User to input a number into the [NWP] field but rather have it be calculated on the form. You see, it has been brought to light that [NWP] is equal to [GWP] – [Ceded] ([Ceded] would be a new field for my table). Since I have heard that you never want to store a value that is dependent on other fields, I eliminated my [NWP] field from my table added [Ceded] and then in the form I added an unbound text box called [NWP_Calc]. In the control source I have the following Vb:

Expand|Select|Wrap|Line Numbers
  1.  =[tblAllForecast!GWP]-[tblAllForecast!Ceded] 
This works great. I modified my [Sum50NWP] with the following formula in the control source:
Expand|Select|Wrap|Line Numbers
  1.  =Sum(IIf([Binding_Percentage]=50,[Forms!Forecast!NWP_Calc],0)) 
but now I am getting a “#Error” in my [Sum50NWP].

Any ideas what I missed?

Thanks,

Keith.
Jun 11 '08 #1
6 3724
kcdoell
230 New Member
Hello Me again:

A further note, that I don’t fully understand, is that my other unbound text box [Sum50GWP] with the following formula in the control source:

Expand|Select|Wrap|Line Numbers
  1.  =Sum(IIf([Binding_Percentage]=50,[GWP],0)) 
Is also getting this same error message “#Error”. Is the fact that since now I am basing my control source of [Sum50GWP] on another calculated unbound control [NWP_Calc] the root of the problem?

Best Regards,

Keith.
Jun 11 '08 #2
Megalog
378 Recognized Expert Contributor
My guess would be to try bracketing each object separately like this:

Expand|Select|Wrap|Line Numbers
  1. =Sum(IIf([Binding_Percentage]=50,[Forms]![Forecast]![NWP_Calc],0))
If it isnt a syntax problem, then maybe it's a format issue.. like NWP_Calc might be text when it needs to be converted to a long number for the Sum.

Or, could be it doesnt like the unbound data with the continuous form.
Jun 11 '08 #3
kcdoell
230 New Member
Hello:

I checked the properties on [NWP_Calc] and it is set to Standard. This is in sync with my [GWP] & [Cede] controls so that should not be it.

I also tried the new syntax but get the same result. Your third idea may make more sense because I indicated that my other unbound text box [Sum50GWP] is impacted as well where I would have thought otherwise since the control source it is not dependent on [NWP_Calc]. If the later is true, what other method could I try?

Thanks.
Jun 11 '08 #4
kcdoell
230 New Member
I have also taken another route with the same result ("#Error"). My form is based on a query, so I added a calculated field in the query [NWP_Calc2] and then when back to the form, went to "field list" and dropped the control into the form. The new control calculates correctly. Then I modified my [Sum50NWP] with the following formula in the control source:

Expand|Select|Wrap|Line Numbers
  1.  =Sum(IIf([Binding_Percentage]=50,[NWP_Calc2],0)) 
I still get the same error in [Sum50NWP]

Any ideas? It worked before when I did not enter this new logic.

Thanks,

Keith.
Jun 11 '08 #5
missinglinq
3,532 Recognized Expert Specialist
If I remember correctly, you can't include a calculated field in a Sum() function, but rather you have to replace the calculated field with the expression that populates the field.

Linq ;0)>
Jun 11 '08 #6
kcdoell
230 New Member
I have also taken another route with the same result ("#Error"). My form is based on a query, so I added a calculated field in the query [NWP_Calc2] and then when back to the form, went to "field list" and dropped the control into the form. The new control calculates correctly. Then I modified my [Sum50NWP] with........... .
Keith.

Okay:

I was playing around with this and stuck with my above query idea. I changed the control name from [NWP_Calc2] to [NWP_Calc] and added the following code to my control [Sum50NWP]:

Expand|Select|Wrap|Line Numbers
  1.  =Sum(IIf([Binding_Percentage]=50,Nz([NWP_Calc],0),0)) 
Checked my other vb on this form, performed a "Compact and Repair Database...." and bang it worked!

Thanks for the ideas.

Keith.
Jun 12 '08 #7

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

Similar topics

3
4613
by: Paul | last post by:
I have an Access 2000 database with a form that is giving me some major headaches. When you open the form, it displays all records and allows editing, but has AllowAdditions set to False so that the user has to use my New Record button. When you click the New Record button, the form presents a new record for editing. My client wants to use the Escape key to cancel changes to new or existing records. On existing records, Access already...
1
3632
by: Chris | last post by:
I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed. Instead of getting my Web page, or the Web Service page, I get a page full of error text (below). I am hoping the anwser will be obvious to someone. I've tried a few things to address the problem, including
1
2109
by: Eric | last post by:
I created a simple web site in VS 2005 and then copied it underneath the IIS tree and created a virtual directory for it. When I try to access the default.aspx page I get the below error text: Note that this is the default web.config file generated by the application. The OS is Windows Server 2003, released version of VS 2005, created an Asp.Net file system web site that does not do anything special and deployed it to test.
13
4649
by: lgbjr | last post by:
Hello All, I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If the user wishes to open or edit an image, I need to save the image in the picturebox to a temp file, then open that file in whatever viewer/editor is the default for the users system. I tried to do picturebox1.image.save(filename), which results in "A Generic error occured in GDI+". However, if I use an unbound picturebox, do a
0
3559
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
9
9682
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
1
3069
by: ApexData | last post by:
Access2k I WAS getting the following error when using the MID function: Run Time Error '13' Type Mismatch I have a new single form, unbound with 1-button on it that uses the following code: Private Sub Command0_Click() MsgBox MID("ABCDEFG", 1, 1)
6
1768
by: JHNielson | last post by:
This is a very simple question.... I have a form that looks up Records for an unbound drop-down list. It has worked just fine up until last night. Now the button on the form to delete a record doesn't work. i get a "compile error: method or data member not found". The code for the drop-down is this: Private Sub REC_ID_COMBO_AfterUpdate()
1
5446
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one group get automatically re-directed after uploading. However, this member group never gets the benefit of knowing if they've uploaded an incorrect file size or incorrect file extension. Members from the second group do see the "exceeds max file...
0
8392
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...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
4151
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
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.