Trouble Getting Module to Work

  • Thread starter Thread starter Frazzled
  • Start date Start date
F

Frazzled

Guest
I'm trying to get a module to display a message that has the form name and the current date. I want the the funtion to run when I open any of the forms.How can I get this to work correctly?
 
In your module, create a public sub procedure...

Public Sub DisplayForm(FormName As String, Today As Date)
MsgBox "Form Name: " & FormName & vbCrLf & vbCrLf & "Today's Date: " & Today
End Sub


In the OnOpen event of each form, place the following code...

Call DisplayForm(Me.Name, Date)
 

Users who are viewing this thread

Back
Top Bottom