Recordset comparisson

Zaeed

Registered Annoyance
Local time
Tomorrow, 02:39
Joined
Dec 12, 2007
Messages
383
Ok, I have a form that after viewing can be approved or rejected. It is possible to have one of the approvers to make a change and then submit the approval. In order to check for a change, is it possible to create a recordset on the form Load, and then another one after the approval button click and do a compare? and if so, how do you do it..

and before you say it, the form is too complicated to do a simple isDirty.
 
I just did a test with that and it returned the modified value...

Basically what happens is, a form will load. If the person has rights to approve the form it is unlocked. The approver inspects the contents of the form and either approves or rejects it.
The special case is if the approver makes a change to the form and then clicks approve. The form needs to know that a change has been made so that the required steps be taken. Between the form loading and the approver clicking approve, no update to the table is made, it is simply values in unbound fields..

any ideas?
 
I just did a test with that and it returned the modified value...

Basically what happens is, a form will load. If the person has rights to approve the form it is unlocked. The approver inspects the contents of the form and either approves or rejects it.
The special case is if the approver makes a change to the form and then clicks approve. The form needs to know that a change has been made so that the required steps be taken. Between the form loading and the approver clicking approve, no update to the table is made, it is simply values in unbound fields..

any ideas?

Not an elegant way, but you could load each value into a variable, or property, which then you could compare against the value at the time the update is made.
 
Ok, i've worked out a way of doing it.

If I create a recordset based on the table, I can do a loops through and check the value of the control to the corresponding value in the table.
Code:
For each fld in rst.fields
     fieldname = fldAbrv & fld.name
     if (frm_Change.Controls.Item(fieldname) <> fld.Value) Or Not (IsNull(frm_Change.Controls.Item(fieldName)) = IsNull(fld.Value)) Then
 
   do whatever

fldAbrv is my identifier for controls i.e. frm_Change_Description, frm_Change_ is the fldAbrv value

Part of this code came from a load/save example I found a while back..
 
My form has a header, the main form, and then two subforms..

how could you use the dirty check in this case?


Hmm, i just read that the Dirty option is only available for bound forms.. mine is unbounded..

any ideas?
 
Last edited:
Before I began the this project, everything I read said that unbound forms were more stable and useful than bounded forms. The system I am building will be for multiple users, and it seemed more logical to design it to be unbounded.
 
So what are you trying to do again? You're off course here. :)
 
haha.. hey adam.. your not wrong.. i think i've succeeded in confusing myself completely. At least its not recordsets that are confusing me atm...

I've put my woes into words on this thread, which i think addresses my problem a bit better. http://www.access-programmers.co.uk/forums/showthread.php?t=152512
I know im probably double posting, but this sums up my issue(s) a lot better.
 

Users who are viewing this thread

Back
Top Bottom