I have a button with the caption set as "Herbarium Collection" in the property sheet.
I programmatically reset the caption to something different but later want it set back to the property sheet value.
So when the button is disabled I want the caption to be "Herbarium Collection"
There are 5 buttons on the form and the captions depend on previous search results.
Is this possible without closing and reopening the form?
I programmatically reset the caption to something different but later want it set back to the property sheet value.
So when the button is disabled I want the caption to be "Herbarium Collection"
There are 5 buttons on the form and the captions depend on previous search results.
Is this possible without closing and reopening the form?
Code:
Private Function setButtons(sSearch As String)
Dim db As Database
Dim rs1 As Recordset
Dim sButton As String
Dim nQuantity As Integer
Set db = CurrentDb
Set rs1 = db.OpenRecordset("listTables", dbOpenSnapshot)
With rs1
.MoveFirst
Do
If !TableName = "Barry collier collection" Or !TableName = "Duplicates" Then
.MoveNext
End If
sButton = !ButtonName
nQuantity = !quantity
If !quantity = 0 Then
Me.Controls(sButton).Enabled = False
Me.Controls(sButton).Caption = property sheet value
Else
Me.Controls(sButton).Enabled = True
Me.Controls(sButton).caption = Me.Controls(sButton).caption & vbCrLf & "Has " & nQuantity & " records with no " & sSearch & " data."
End If
.MoveNext
Loop While Not .EOF
End With
End Function