ENABLE a field based another field.

Xx_TownDawg_xX

Registered User.
Local time
Yesterday, 22:26
Joined
Jan 16, 2009
Messages
78
Basically, I'm trying to ENABLE a field based another field.

Code:
If Me.Auditor_ID.Value = "LR" Then
        Me.Series_Master.Enabled = True
I'm close, but no cigar. What am I doing wrong?
 

Attachments

  • codefix.jpg
    codefix.jpg
    101.6 KB · Views: 373
Put your code in the After_Update event of the control that the dependent control is based on. Also, put an End If.

By the way, you enable/disable controls, not fields. ;)
 
The event procedure is "after update".. and I added the missing "end if"

Code:
Private Sub Auditor_ID_AfterUpdate()
    If Not IsNull(Me.Auditor_ID.Value) Then
        Auditor_ID.DefaultValue = """" & Me.Auditor_ID.Value & """"
    End If
    If Me.Auditor_ID.Value = "LR" Then
        Me.Series_Master.Enabled = True
    End If
End Sub

When I try to compile, it is hanging on Enabled
 

Attachments

  • codefix1.JPG
    codefix1.JPG
    59.1 KB · Views: 316
Your Auditor control could be a Label and not a text box.
 
Auditor_ID is the combo box. Auditor_ID_Label is the label. (yes I know.. cboAuditor_ID would have been preferred. ;))

It's got to be simple if I provide you with all the information you need.
 

Attachments

  • codefix2.JPG
    codefix2.JPG
    89 KB · Views: 322
Well duh.

Code:
Private Sub Auditor_ID_AfterUpdate()
    If Not IsNull(Me.Auditor_ID.Value) Then
        Auditor_ID.DefaultValue = """" & Me.Auditor_ID.Value & """"
    End If
    If Me.Auditor_ID.Value = "LR" Then
        Me.cboSeries_Master.Enabled = True
    End If
End Sub

The "Auditor_ID" was all right, it was the "other control." (I was trying to set the ENABLE on the field name, not the control name.)

THANKS GUYS.
 

Users who are viewing this thread

Back
Top Bottom