Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a Filter By Form Macro be converted to a Module

Status
Not open for further replies.

Patentinv

Technical User
Aug 26, 2005
84
US
Hi,
Can a Filter By Form Macro be converted to a VB Module code
and then the converted code be placed in onclick event procedure of command button in place of where the macro was that was working fine and have it work like the macro did, in Access 2003 Reg mode, Not Runtime mode?

If so I sure can't get it to work, I thought in runtime mode was where there were problems with the Filter By Form, I can't even get it to work in regular mode let alone runtime.

Here is the converted module code that I can't get to work

Private Sub Command139_Click()
Function Find_Applicant()
On Error GoTo Find_Applicant_Err

DoCmd.Echo False, "Please Stand By"
DoCmd.Hourglass True
DoCmd.RunCommand acCmdFilterByForm
DoCmd.RunCommand acCmdClearGrid


Find_Applicant_Exit:
Exit Function

Find_Applicant_Err:
MsgBox Error$
Resume Find_Applicant_Exit

End Sub

Thanks--For any help
 
Remove the following line:
Function Find_Applicant()

And replace this:
Exit Function
with this:
Exit sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top