Okay tried the below...
Private Sub cboState_BeforeUpdate(Cancel As Integer)
If DLookup("llStateID", "qryLister", "btBrokerID = txtBrokerID") <>
Me.cboState Then
DoCmd.CancelEvent
Me.Undo
MsgBox "No Listings in this State/Province", vbInformation,
"State/Province"
End If
End Sub
But now it won't look up anything. My thought was if I could see if the
State was in the table then okay find the Listings but if it's not in the
table show the message. But I get the message all the time because it's not
really searching the entire table. I may need more coffee... any ideas out
there???
Thanks,
Gina Whipp
"I feel I have been denied critical, need to know, information!" - Tremors
II
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:(E-Mail Removed)...
> The problem, as you doubtlessly know, is that txtBrokerID will be null
> when there's no data.
>
> Try:
>
> SELECT btTerritoryStateID
> FROM tblBrokerTerritory WHERE
> btBrokerID = [Forms]![frmLister]![txtBrokerID]
> OR [Forms]![frmLister]![txtBrokerID] IS NULL
> UNION
> Select "ALL" as Bogus FROM tblBrokerTerritory;
>
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Gina Whipp" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Gurus,
>>
>> Here's my problem...
>>
>> I have a combo box with pulls the Brokers territory via the query below,
>> works perfectly... EXCEPT
>>
>> SELECT btTerritoryStateID FROM tblBrokerTerritory WHERE
>> (((tblBrokerTerritory.btBrokerID)=[Forms]![frmLister]![txtBrokerID]))
>> UNION Select "ALL" as Bogus FROM tblBrokerTerritory;
>>
>> If the Broker has no Listing in that territory the whole form goes blank
>> and you have to close the form and reopen it. I have tried requerying
>> and undoing but the form still goes blank. I have tried this on the
>> Not_In_List, Before_Update and After_Update event. Please note, I do
>> want to show all their territories because I want to give a message that
>> says "No Listing in this State/Country".
>>
>> Any ideas?
>>
>> Thanks,
>> Gina Whipp
>>
>> "I feel I have been denied critical, need to know, information!" -
>> Tremors II
>>
>
>