Condtional Formatting of captions

kedarj

Registered User.
Local time
Today, 03:09
Joined
Sep 7, 2005
Messages
58
I want to change the Caption of a textfield depending upon a value selected from a combo box. i.e. If the user selects 'Scientist' from combo box, then the caption to enter name should be 'Scientist Name' if the user selects 'Engineer' then caption should be 'Engineer Name'. Can anyone guide me how this can be done?
Thanks
 
You could use

If me.Combobox="Scientist" then
Your Label Name.Caption = "your caption"

Not sure if this is what you wanted or not.


Alastair
 
Code:
Private Sub cboName_AfterUpdate()

    Me.lblName.Caption = Me.cboName.Column(0) & " Name:"
    
End Sub
In code, the column numbers start at zero.

Note that what you see in the combobox is governed by the Column Count and Column Widths properties of the combobox itself and not by the code above.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom