Hello, I was wondering, I have a function and I want the user to enter a control they have (label, form, commandbutton, anything that can do .caption). But I don't know how I can do this...
Module:
Basically my question is.. how can I get cmd.caption=total, lbl.caption=total etc. into just one. Example: obj.caption=total. Thanks.vb Code:
Option Explicit Dim i As Integer Dim Start As Long Dim EndT As Long Dim Total As Double Dim DoTime As Integer Declare Function GetTickCount Lib "kernel32" () As Long Public Function TimerStart(Optional Lbl As Label, _ Optional Cmd As CommandButton, _ Optional Frm As Form) As Long i = i + 1 If i = 1 Then Start = GetTickCount End If EndT = GetTickCount Total = (EndT - Start) / 1000 Cmd.Caption = Total Lbl.Caption = Total Frm.Caption = Total End Function Public Function TimerReset() i = 0 End Function
I wasn't quiet sure how to ask this, I hope it wasn't too confusing.




Reply With Quote