Prefix Text box based on combobox selection

whitelockben

Registered User.
Local time
Today, 17:07
Joined
Jun 29, 2011
Messages
25
SOLVED: Prefix Text box based on combobox selection

Hi all,

I want to add a prefix to a text box based upon a selection from a combobox.

Specifically,

if cboSeg = C&I txtCN prefixed 'C'
if anything else prefixd 'P' and if nothing, no prefix.

Can someone help me with this please.

Thanks,

Ben.
 
Last edited:
Try the following code in the "After Update" event of your combo box:
Code:
If Not IsNull(Me.cboSeg) Then
     If Me.cboSeg = "C&I" Then
          Me.txtCN = "C"
     Else
          Me.txtCN = "P"
     End If
Else
     Me.txtCN = ""
End IF
 

Users who are viewing this thread

Back
Top Bottom