Form Name as Variable

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top