G
Guest
I have a progress bar on a form, but I want about 15 more of them. Each one
accesses 2 different field values, looked up using a domain function. The
part of code in the function that I need help with is here:
sngPct = varAmt / varTotal
If sngPct <= 1 Then
Me!baselbl.Caption = Int(sngPct * 100) & "%"
Me!lblmeter.Width = CLng(Me!baselbl.Width * sngPct)
Else
Me!baselbl.Caption = "Greater than 100% - Check your amounts"
Me!lblmeter.Width = CLng(Me!baselbl.Width * 1)
End If
How can I change this so it runs for all 15 objects instead of copying the
whole function for each object? (baselbl1 and lblmeter1 thru baselbl15 and
lblmeter15) Use a select case for each item?
accesses 2 different field values, looked up using a domain function. The
part of code in the function that I need help with is here:
sngPct = varAmt / varTotal
If sngPct <= 1 Then
Me!baselbl.Caption = Int(sngPct * 100) & "%"
Me!lblmeter.Width = CLng(Me!baselbl.Width * sngPct)
Else
Me!baselbl.Caption = "Greater than 100% - Check your amounts"
Me!lblmeter.Width = CLng(Me!baselbl.Width * 1)
End If
How can I change this so it runs for all 15 objects instead of copying the
whole function for each object? (baselbl1 and lblmeter1 thru baselbl15 and
lblmeter15) Use a select case for each item?