Comparing fields in Access

DeborahP

Registered User.
Local time
Today, 05:49
Joined
Jul 24, 2002
Messages
42
I have a database with a pre-surgery field and a post-surgery field. The use must enter the current procedure in the pre-field and then the actual surgery in the post field. I need to check to see if the fields match verbatim. The field is a memo field.

The users know how to copy and paste from the pre to the post fields. 90% of the time it is the same but not always.

Can anyone provide some help?

Thanks,
Deborah
 
do you want to check existing data for sameness or find a way to copy data?

instead of cutting and pasting you could add a button to copy the data:

Private Sub cmdCopy_Click()
me.postopfield = me.preopfield
End Sub

users can make adjustments, if necessary, after copying.

hth

i just noticed your thread title - you want to compare fields. still not sure though: should all fields - pre and post - read the same, or will some be different (10%)? if they should all be the same you could create an update query and very easily make them all the same.
 
Last edited:
You could use the forms On_Close event and write some code to check if the values match. Something like below


if me.PreSugery<> me.PostSurgery then
msgbox("The two Surgies do not match")
Cancel=-1
End if

The code above will check to see if the surgeries entered match when the user tries to close the form. If they do not match a message box will pop up and the form will remail open.
 

Users who are viewing this thread

Back
Top Bottom