Cmd button caption not displaying

Prayder

Registered User.
Local time
Today, 12:58
Joined
Mar 20, 2013
Messages
303
I am building a form and part of the code is:

Code:
 Private Sub Form_Load()
    lblSalary.Caption = "Enter Salary"
    txtSalary.Value = "5000.00"
    cmdIncrease.Caption = "Increase Salary"
End Sub

The problem I am having is that I dont understand why the cmdIncrease button does not display "Increase Salary" when the form loads. The button is there but it is blank. The lblSalary button displays "Enter Salary" with no issues.... and I do not have "Enter Salary" in the caption property window... only in the coding window but it still works.
 
My guess is the button is not referred properly.. See if the Name of the button is named exactly as it is in the design mode, and that you are referring to that control.. Check spelling, width and height of the button if it could support the text "Increase Salary"..
 
Checked all those. I guess I will just type it in the caption property within the Property sheet and not worry about having it in the code window.

Thx anyway!
 
Oh that's strange.. Because I use similar code to change the Button caption based on policy status, and it works good on mine.. I use the Form Current though..
Code:
    Select Case Me.policyStatus
        Case "Suspended"
            Me.reactivateBtn.Caption = "Unsuspend Policy"
        Case "Lapsed", "Cancelled"
            Me.reactivateBtn.Caption = "Reactivate Policy"
        Case "Quote"
            Me.reactivateBtn.Caption = "Activate Quote"
        Case Else
            Me.reactivateBtn.Caption = "Update Policy"
    End Select
 
WOW!!!! Just realized that I had two separate code windows open and they both had some of the same procedures so when I was updating one I was not paying attention to which I was saving... Such a NOOB!!!
 

Users who are viewing this thread

Back
Top Bottom