Originally Posted by
orange
TRY this: (guessing)
Code:
If Len(Me!Company_Name & Me!Country) = 0 Then
btnAdd.Enabled = False
Else
btnAdd.Enabled = True
End If
Where exactly are you running this code? That is, which event?
I see you said they are 2 combo boxes, which are usually prefixed cboXXXX ans cboYYY.
Perhaps you could post a copy of the db so we can see the details and context.
Code:
Private Sub Company_Name_Change()
If Len(Company_Name.Value & Country.Value) = 0 Then
btnAdd.Enabled = False
Else
btnAdd.Enabled = True
End If
End Sub
Private Sub Company_Name_LostFocus()
If Len(Company_Name.Value & Country.Value) = 0 Then
btnAdd.Enabled = False
Else
btnAdd.Enabled = True
End If
End Sub
Private Sub Country_Change()
If Len(Company_Name.Value & Country.Value) = 0 Then
btnAdd.Enabled = False
Else
btnAdd.Enabled = True
End If
End Sub
Private Sub Country_LostFocus()
If Len(Company_Name.Value & Country.Value) = 0 Then
btnAdd.Enabled = False
Else
btnAdd.Enabled = True
End If
End Sub