I have a lot of code in a cash register program that has to repeat itself so I am looking to call the code in a public function for all the good reasons that exist with that.
I can't seem to get the syntax correct for what I want to do. Here is a simple version that I can't get working (the msgBox works, but the make button visible line gives me an errror:
In the Cash Register form I have:
Private Sub testButton_Click()
Call myViews
End Sub
Then in the Modules I have:
Public Function myViews()
MsgBox "hello"
Forms![Frm Cash Register]!testButton.Visible = False
End Function
Any and all help will be greatly appreciated.
Thanks.