
Originally Posted by
Perfac
Thanks all. It works well.
I can't imagine it is working well.
You don't do anything with "me.YYY". That variable says whether the feature is already being used. I think the message box always pops up if the "AppearanceA" is equal to "once".
And if it appears, you still leave the chosen value.
You have also adjusted your requirements in the meantime. First (in your other post) you wanted to show where the chosen values were used. Apparently that is no longer necessary.
Code:
Private Sub cboEntFea_AfterUpdate()
Me!XXX = DLookup("AppearanceA", "q01EntityFeatures", "EntfeaID =" & Me.cboEntFea)
If Me.txtEntFea1 = 1 Then
Me!YYY = DLookup("EntityNameA", "q01CombinedEntities", "Entfea_IDa =" & Me.cboEntFea)
Else
Me!YYY = Null
End If
If Me.txtEntFea1 = 1 And Me!XXX = "Once" Then
MsgBox "Entity Feature Already Used"
End If
End Sub