Pass userform reference to public function

I am setting up some vba userforms for grabbing info in Microstation and storing it in an access database.  Since the forms will be doing the same thing for different data, I wanted to write public functions for the form actions (clear form, check for duplicate records, etc)  So I tried to pass the "Me" keyword to the function with:

Public function clearform( frm as form)

for each ctl in frm.controls

blah

blah

end function

in the forms button I would have

clearform(me)  'to call the funtion.

I am getting type mismatch error.

I don't know if I am missing a reference,  I've tried different variations like "frm as userform"

If anyone had an example I would greatly appreciate it

Thanks in advance