Referencing a Form in a Function

Referencing a Form in a Function

Hello -

I have a function (call it "check_for_dups") that is currently used to identify potential duplicate records on a form.  I have recently created a copy of the form, modified it slightly, but the field names that are used in the check_for_dups function are all the same.

I'd like to re-code the check_for_dups function to work for either of these two forms by referencing a form as a variable instead of using the actual form name throughout the function. However, I don't see a method to declare a form as a variable within a function.   

Can anyone suggest an approach?

Thanks!