Form Name as Variable

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

Hi,

I have the following subroutine:

Public Sub SetMeterBasic(p As Single)
' This subprocedure is used to update the progress meter bar
With Forms![FormA]
.shpMeterBar.Width = p * .lblMeter.Width
.lblMeter.Caption = Format(p, "##%")
.Repaint
End With
End Sub

FormA is a form from which I called the main subroutine of the program which
then later called this procedure. Is there a way I can pass a form name to
Sub SetMeter e.g. so its first line is Public Sub SetMeterBasic(p As Single,
FormName as String) where the variable FormName can function as "FormA" does
in the current procedure. Also, is there a way the procedure could detect
what form started the whole set of routines and use that form?

Thanks
 
Back
Top