Changing & recalculating default values on a form

There are a number of occassions in my application where I use a calculated 
control (1) as the default value for an unbound control (2).  Most of the 
time the user will accept this value and move forward; however, if one of the 
underlying values upon which the calculated control (1) is based changes, I 
would like the value of the unbound control (2) to be updated.  I do not want 
to bind the control (2), because there will also be a few times when the user 
will need to change its (2) value independent of the value calculated in 
Control (1)

Can I do this?  Thanks so much.
0
Utf
12/22/2007 2:23:00 PM
access 16762 articles. 3 followers. Follow

1 Replies
1354 Views

Similar Articles

[PageSpeed] 21

=?Utf-8?B?TGVMZQ==?= <LeLe@discussions.microsoft.com> wrote in
news:856F8507-4FFA-48BD-B382-ABD406B8BFF0@microsoft.com: 

> There are a number of occassions in my application where I use a
> calculated control (1) as the default value for an unbound control
> (2).  Most of the time the user will accept this value and move
> forward; however, if one of the underlying values upon which the
> calculated control (1) is based changes, I would like the value of
> the unbound control (2) to be updated.  I do not want to bind the
> control (2), because there will also be a few times when the user 
> will need to change its (2) value independent of the value
> calculated in Control (1)
> 
> Can I do this?  Thanks so much.
> 
For each control which allows changing an underlying value, put a 
statement in the control's After Update event to recalculate the new 
value for control (2) and update the value of that control.

Example.
private sub txtControl3_AfterUpdate()
   txtControl2.value = (txtControl3+txtControl5)/9
end sub.

-- 
Bob Quintal

PA is y I've altered my email address.

-- 
Posted via a free Usenet account from http://www.teranews.com

0
Bob
12/22/2007 1:55:59 PM
Reply:

Similar Artilces:

Copy Formula with Reference Change
I have a workbook that will have 100+ sheets in it. I want to use a beginning number in a cell on the first sheet and then on the following sheets in the same cell have a formula that adds 1 to the number in the same cell on the previous sheet. For example, the first sheet has 497 in cell B2. In each successive sheet, I would have a formula in cell B2 that would be '=sheet1!B2+1' to give me 498, then 499, then 500, etc. I want to copy the formula to each successive sheet and have it automatically adjust the sheet it is referencing to be the previous sheet. However, when ...

changing c sharp background
hi; i want to set a picture to the console application if u know how plz answer me i know how to chang the background color but i dont know how to set a picture to it thanks for all answer ... :) A console application ? Doesn't seems to make sense as this is a character mode device... Else please be more specific (you want to use a picture as a background for a System.Windows.Forms.Form object ?) -- Patrice "sahel" <nam.nam.barooon@gmail.com> a �crit dans le message de groupe de discussion : 8e8e7758-2a82-436d-8e76-6ea5acabb025@15g2000yqi.googlegro...

Converting/inserting values, without changing the other contents.
Hi all this is what i require: the overdue is INR 250k (SGD 7,543), out of which for INR 125k (SGD 3,771) payment is processed, for INR 30k (SGD 905) bills resubmitted for queries, for INR 25k (SGD 754) supporting were resubmitted, for INR 45k (SGD 1,358) payment will be made in 1week of next month. the above comments will be in m5 without the sgd value, i need help to converrt those values and show as above in n5, after multiplying the converting factor at b2 thank you ...

Validating Data on a Form with a subForm
I have a form with subforms with data validation in the main Form's Before_Update Event. The problem that I am encountering is when the user has not updated all required data but enters the subform the Form Before_Update Event fires and the validation will fail. Is there a way to know what the next object has been selected might be or how I would not perform the Form's validation when the subform has been selected? Any help will be appreciated!!! No. Access saves the main form's record at the point when you move from the main form into the subform. Any record that fails v...

Track Changes History Worksheet
In a shared password protected workbook, I would like to keep the History worksheet displayed all the time. Currently, every time I open up the workbook, I have to go to Track Changes and click on List Changes in a New Sheet. Thank you for your help! ...

2003 wont send new mail from default account
I am running Office Pro 2003 SP1 I have read several postings and accept that Outlook will reply to mails via the account the was received from. However, i have added a new account and set it as default, but mail still gets sent from my other account. This even happens when i select the account from within the new mail... the message says 'This message will be sent via mail.mydefaultdomain.com'.. but its actually gets sent via the non default account.. How do i sort this as it is really annoying.. On 19 Jan 2005 14:44:35 -0800, Winshent wrote: > I am running Office Pro 2003 SP1...

Read values from excel rows
hi I am trying to read the values from a excel row. There are 89 columns for each row and same number of data in each rows. Kindly help regards shantanu shantanu, You need to explain how/where you want to read them.... From another workbook, another worksheet, a VBA function, a macro, a C# application? HTH, Bernie MS Excel MVP "shantanu" <shantanusenin@gmail.com> wrote in message news:1184298794.259390.216180@i38g2000prf.googlegroups.com... > hi > I am trying to read the values from a excel row. There are 89 > columns for each row and same number of da...

phone textbox default value problem
I have a phone field and I have a default area code set and when I tab to the field the area code is highlighted and I have to click off of it to enter data. How can I have it so when I tab to the field I can immediatly start typing the phone number after the area code? If the area code is different than the default I figure I could just back space and change it. 90% of the time the default will be correct. I have the input mask as !\(999") "000\-0000;0;_ and the default value as (916), I am leaving the formatting info in because I have to import the data and it has the...

How to update one form when closing another ?
I have two forms open. frmPeople has the Focus frmAccount does not. frmAccount has subFormPeopleList I add a new person to frmPeople (which is linked to frmAccount) Question 1: When I close frmPeople I want to update frmAccount so the new person shows in subFormPeopleList Quetion 2: But I'm also wondering if I add code to the "close event" for frmPeople to update frmAccount What will this do if frmAccount is not open? Will it add the person twice? I'm guessing not as updating a form doesn't really add data to the table... right? Thanks for any help. Mel Thanks...

leading zero value help
Hello, I have two tables with a text field and the value in the field range from 50 to 9999. 50 is 2 characters, 100 is 3 characters and 9999 is 4 characters. I ran into a problem when referencing these values in calculation. How or what can I do to put two leading zero to 2 character field and one zero to 3 character field on all existing records? (Maybe a macro, I don't know) There are currently over 2000 records so it is sufficent to manually change them all. Any help is appreciated. Example: 50 = 0050 200 = 0200 950 = 0950 >>I ran into a problem when referencing thes...

Changing the "reply to" on emails
I have several support reps who monitor a queue for customer support requests and then reply to the customer using a CRM email activity. We want any customer reply to our email to be sent to the email address asssociated with the queue. Currently, the emails we send via the CRM use the support rep's email address for the "sent from" and "reply to" addresses. The problem is that when the customer replies to that email, the reply is sent to the support rep's outlook vs back into the support queue. The support rep could be on vacation, etc. I tried settin...

Two tables, one form
I have a form that I created in AC2003. This form will merge info from two tables. So I assigned Table1 as the source for the form, inserted all of the columns from Table 1. Next, I changed to source for the form to Table2 and again inserted all of the columns from Table2 onto the form. I then changed the name of all Table2 columns to precede it with an "n". i.e. FirstName became nFirstName. All source for those items for Table2 were changed to have no source. Again, the source for the form is Table1. I lookup a row in Table1 in Table2 and if a match is found, ...

Changing Outlook from Exchange Services to IMO version
How can you reinstall Office 2000 and change the Outlook "type" from using Exchange/Internet Mail to Internet Mail Only (IMO)? I uninstalled my version of Office2000 and reinstalled it from my CD. However it doesn't give me the option to install the IMO version of Outlook. It installed the Exchange/Internet Mail automatically. Without an exchange server the checking of email is dog-slow. Thanks, Alex Moylen Hi, Alex. Alex Moylen ha scritto: > How can you reinstall Office 2000 and change the Outlook > "type" from using Exchange/Internet Mail to Internet Mail ...

enter data to different tables through one form
i have 5 tables. all of them has pers_no as primary key. they have one to one relation ship through the primary key amongest them. i want to create one form having a text box pers_no where i will enter the data and i want the data to get entered in each table. so how i am not able to do that. i request all you guys to help me. thank you. Sorry for the bad news, but that's not the right way to use Access. You cannot write to 5 tables from one form like that. If you are subclassing, you could create a form for entering the main form info, and then 5 subforms (probably on tab pages) f...

Enforce a default company wide signature?
I have a client that wants to enforce a default disclaimer on all their outbound e-mails. Is it possible to set something like this via the server? Either through Exchange (any version but 5.5 in particular) or via Active Directory in Windows 2000. I downloaded and looked through the Administrative templates that come with the Office Resource kits and can only enable or disable a signature, not set the signature text itself. Any help is appreciated. Thank you, Brian Hi - this would be best posted in an Exchange newsgroup. However: http://www.msexchange.org/tutorials/Adding_Email_D...

Form to search
I have just imported a list of addresses and design a form which is linked and i can add and change the lists via the form. But i would like to be able for so one who uses the database to be able to open it and use the form to also search through the database to find a certain address and amend if needed. Many thanks Niel, Put a button on the Form header and add this code into the Click event: rst.MoveFirst Do Until rst.EOF rst.Edit rst![mCheck] = 0 rst.Update rst.MoveNext Loop rst.Close Set rst = Nothing If you want to alternate from check to unchecked change line, rst!...

How to read values from a table?
Hi, I am trying to redesign an old database. I have three forms start, entry, edit forms. Start form is like a switch board to enter into the forms. An audit is entered into the database through "Entry" form which has around 50 controls. All these controls gets stored in the main table. "Edit" forms allows you to edit the audit. The issue here is the "Edit" form doesn't read the values from the main table when the form is loaded. I have a logic to read the values from the main table in "start" form. Everything looks fine with the SQL statemen...

Scatter plot
I have an XY scatter graph with some points in it. My data in the spreadsheet looks like this: [Title] [X-value] [Y-value] [size] Data 1 | 10 | 10 | 1 Data 2 | 33 | 44 | 5 What I want to do is to change the size of the data point according to the value I specify. Right now, I have to individually modify each point and add a number corresponding to the size. Is there anyway to take the size-value from the spreadsheet and change the size of the point in the graph? In the long run, I am also looking to modify the color. If the solution requires some VBA coding, I am up for that. Any sugges...

PO notes to POP PO Blank Form
There is a TK, 858264, that tells how to add notes to the POP Blank form. Is there a limit to how many notes you can add this way? I have added 14, but when I add the 15th I get an illegal syntax error. Is there a limit to the number of notes I can add? thanks -- Doug Doug, I believe this is a limitation of the PO report itself. We had trouble in the past when trying to link to many tables, or place to much data in the PO report. We would get the same error you are receiving. "Doug" wrote: > There is a TK, 858264, that tells how to add notes to the POP Blank form....

Data value display attributes linked to table attributes
Is there a way to cause data value points to take on attributes such as bold, italic or color set at the table from which they are derived? For example, suppose I was charting hits at several web sites as function of time, and the some characteristic of the site was being altered back and forth (say font "A" and font "B") as part of an experiment. I can easily produce a line graph x=hits y=time for the various sites, but these is no way to visualize which condition (A or B) was in effect at each data value point. I'd like to be able to display the portion of each li...

Rename name so formulas show name change
Excel 2003 Cell A1 is named MyCell. Cell A2 has formula "=MyCell". I rename cell A1 in the toolbar to NewCell. Cell A2 still has the formula "=MyCell". How do I rename cell A1 to NewCell and have it automatically change cell A2 to the formula "=NewCell"? Thank you for your help. Download Jan Karel Pieterse'e Name Manager here: http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.asp -- Kind regards, Niek Otten Microsoft MVP - Excel "John" <no.email@no.email.com> wrote in message news:ORne6k3$GHA.4592@TK2MSFTNGP03.phx.gbl... | Excel 2003 |...

Icon won't stay changed!
I use properties to change the icon on one of my desktop icons. It appears to accept the change, but when I go back to my desktop, the original icon appears - it ignores my attempted change. This is on my up-to-date XP on my new Acer netbook. TIA, Paul I use properties to change the icon on one of my desktop icons. It appears to accept the change, but when I go back to my desktop, the original icon appears - it ignores my attempted change. This is on my up-to-date XP on my new Acer netbook. TIA, Paul (I've posted this on multiple groups, because my original post on...

Two different values in a single cell...
Hi, Is it possible to have two different values (coming from another sheet) in a single cell? For example, 0.87 (0.97) In that case 0.87 comes from a cell on sheet1 and 0.97 from a cell on sheet2. Thanks for the help. Patrick, Hi You can concatenate two results into one cell. This makes it inot a text cell, however, so you cannot do maths on it quite so easily. To join the info, just use the CONCATENATE function, or the & sign =A2&" " &A3 You may also need the TEXT funtion, depending on what format you want the result to be -- Andy. "Patrick" <an...

Empty sub-form???
Three forms, a parent, "DirectoryItems" and two sub-forms, "FamDirItems" and "PermissionBoxes". When ANY of the controls in "FamDirItems" get the focus, Sub ShiftPB (code below) is called to change the vertical location of the 2nd sub-form and its filter expression. However, the resulting sub-form becomes empty. When I run essentially the identical code in the code-sheet of the sub-form with a series of values, entered via InputBox, as substitutes for Me.FamilyID the form displays according to the value I entered and perfect in every way. Is there som...

Change Label based on Two Combo Boxes
Hi, I currently have this code in AfterUpdate event for Combo2, hoping it would change label1, but it does not work. : If Me.Combo1.Value = "State" And Me.Combo2.Value = "2008" Or "2007" Or "2006" Then Me.Label1.Caption = "Select a State:" ElseIf Me.Combo1.Value = "City" And Me.Combo2.Value = "2009" Or "2010" Or "2011" Then Me.Label1.Caption = "Select a City:" Else Me.Label1.Caption = "Select a Number:" End If The label does not change when I make changes to the combo...