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 December 11th, 2003, 09:09 PM
smilegloria smilegloria is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 26 smilegloria User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to know a field is changed inside a form?

Hi all,

I have a form for Customer Purchase Order. Inside this form, there are two buttons, one for detail entry and the other for detail update. These two buttons will also open the same form when clicked.

For detail entry, the form is empty so that after user input all the fields and click the OK button, the whole detail will be written to one table as a transaction and save the corresponding form data to another table.

For detail update, the previous inputted detail will be loaded. There is a input field [Qty], how can i know if this field has changed and get the new [Qty] when the user click the OK button?

My current method is to write an event procedure for the OK button. So everytime when the OK button is clicked, the transaction table will have a new record. It works fine for new detail entry..but for detail update, I don't need to insert a new record in the transaction...how can I perform my task correctly?

Thanks!

Gloria

Reply With Quote
  #2  
Old December 15th, 2003, 02:21 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
Try using the Dirty event of the form. The Dirty event occurs when the contents of a form or the text portion of a combo box changes, but this event applies only to bound forms, not an unbound form or report.

If your form is unbound I recommend to store the old value in a variable and compare it to the control's value when the OK button is clicked.
__________________
BRegs,
TBÁrpi
"I can only show you the door. You're the one who has to walk through it."

Reply With Quote
  #3  
Old January 22nd, 2004, 04:24 PM
fraga fraga is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 1 fraga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
use defaultValue Property

I believe you can use the defaultvalue property of the control and compare with the value to see if it changed.

It just changes depending the control you are using. For example text box is defaultvalue and radio button is defaultChecked.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > How to know a field is changed inside a form?


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