I have a piece of code that I want to be able to call from several different forms when the On Current event is triggered. I am trying to store the name of the form calling the code in a varible and then use the variable
On Current Event
Private Sub Form_Current()
Dim FormName As String
FormName = Me.Form.name
Generic code being called
Function OLEDisplay(FormName As String)
On Error GoTo ErrHand
If FormName.OLEFile.LpOleObject <> 0 Then
FormName.OLEFile.Visible = True
'If we are here there is no OLE File for the row. So we do not need to display the object.
FormName.OLEFile.Visible = False
I get an error when I try to compile that says "Invalid Qualifier". Is it possible to do what I am attempting to do?