Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 10th, 2004, 08:16 PM
equipe9 equipe9 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 equipe9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Writing form value back to a field in a table.

I have a form called Account with the following fields on it as textboxes which pull values from an underlying table called Account.

OriginalBalance
TerminMonths
DiscountFactor

Additionally there is another textbox called PaymentDue which has the following formula under the Control Source

=[OriginalBalance]*[DiscountFactor]/[TermInMonths]

This calculates the value of paymentdue as desired but I can not figure out how to write the value of paymentdue back to the paymentdue field in the Account table.

Is there an easy way to set some sort of proprty to do this?

I've tried writing an update query launched via a command button as follows also to no avail.

UPDATE Account SET Account.PaymentDue = [Forms]![Account]![txtPaymentDue]
WHERE (((Account.PaymentDue)=[Forms]![Account]![txtPaymentDue]));

Thanks in advance for your help.

Reply With Quote
  #2  
Old February 10th, 2004, 09:53 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Which field in the table is the primary key?

S-

Reply With Quote
  #3  
Old February 10th, 2004, 10:21 PM
equipe9 equipe9 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 equipe9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by sbaxter
Which field in the table is the primary key?

S-


AccountNumber is the primary key which is also on a textbox on the same form which pulls values from the same underlying table.

Reply With Quote
  #4  
Old February 11th, 2004, 09:50 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
UPDATE Account SET Account.PaymentDue = [Forms]![Account]![txtPaymentDue]
WHERE (((Account.AccountNumber)=[Forms]![Account]![txtAccountNumber]));

S-

Reply With Quote
  #5  
Old February 11th, 2004, 08:54 PM
equipe9 equipe9 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 equipe9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by sbaxter
UPDATE Account SET Account.PaymentDue = [Forms]![Account]![txtPaymentDue]
WHERE (((Account.AccountNumber)=[Forms]![Account]![txtAccountNumber]));

S-


Awesome, I got the query to work.

Now is there a good place to put this query so it autoruns when either the form is loaded or changed instead of on a manual button?

I think there is some setting for this, or event which I can't remember what it is.

Reply With Quote
  #6  
Old February 11th, 2004, 11:14 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
I would put it in an after_updated event of one of your textboxes the this is driven off of.

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Writing form value back to a field in a table.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway