|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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." |
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > How to know a field is changed inside a form? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|