If you are using Form_BeforeUpdate, and the event is not cancelling, then
the condition is not being met.
For debugging purposes, break the line into 2:
If Me!AcctDecision.Column(1) = "Pending" Then
Debug.Print "Pending"
If IsNull(Me!AcctCode) Then
Debug.Print "AcctCode is null. Cancelling."
Cancel = True
strControl = strControl & "Select an Account Name" & vbCrLf
End If
End If
Add an inappropriate record, and see which part of the condition is not
being met. For example, the second column of your combo may not contain
"Pending" (remember the Column() property is zero-based), or the AcctCode
might contain a zero-length string instead of a null (which you can avoid by
setting its Allow Zero Length property to No in table design.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"JOM" <(E-Mail Removed)> wrote in message
news:37E369DA-C83F-446B-AE1A-(E-Mail Removed)...
> Allen the code is in the beforeupdate event of the form.....
>
> "Allen Browne" wrote:
>
>> Move the code into the BeforeUpdate event of the *form*, not that of the
>> control.
>>
>> You have no idea which box the user will fill in first, or which order
>> they
>> will change them. Form_BeforeUpdate will fire just before the record is
>> saved, so cancelling this event will prevent the save.
>>
>> "JOM" <(E-Mail Removed)> wrote in message
>> news:8D87155D-3530-45B6-A34C-(E-Mail Removed)...
>> >I have 2 comboboxes on my form, (AcctDecision, AcctCode)
>> > AcctDecision has the following values in it... (Accept, Deny, Pending)
>> > AcctName has the following names ( XYZ, ABC, DEF)
>> >
>> > So what I am getting into is that if I select Pending in the AcctCode
>> > Combobox, I need to select something in the AcctName. My code is
>> > making
>> > me
>> > be able to save the record with the ACCTName blank when the Acct Code
>> > is
>> > Pending.
>> >
>> > Dim StrControl as string
>> >
>> > strControl = ""
>> > If Me!AcctDecision.Column(1) = "Pending" And IsNull(Me!AcctCode) Then
>> > strControl = strControl & "Select an Account Name" & vbCrLf
>> > Cancel = True
>> > End If
>> >
>> > if strControl <>"" then
>> > msgbox " Enter missing informatio": & vbcrlf & strcontrol,
>> > vbinformation, "Incomplete Information"
>> > End if