pop-up a message if there is no data

mkkashif

Registered User.
Local time
Today, 09:00
Joined
Sep 1, 2004
Messages
88
Dear Sir
i am using the following code for combo box.
i have a combo box search which have the customerid control
i have a other combo box billno.
when i select a customerid the other combobox select the "billno" against the CustomerId
as you can see the code .
i just want to do that if there is no data against any customerid in Billno combobox then
a message pop-up.

waiting your help
'''''''''''''code''''''
Dim sbillno As String

sbillno = "SELECT [bill2].[autonumber] " & _
"FROM bill2 " & _
"WHERE [CustomerID] = '" & Me.search.Value & "'"
Me.Billno.RowSource = sbillno
Me.Billno.Requery
 
hi Kashif

use an if statement here such as

if isnull(me.bill2) or me.bill2 = "" then
Msgbox "YourMessage",YourButton,"YourTitle"
me.nextfield.setfocus
endif

This code should go on the Afterupdate event of your CustomerID

This should work..
 

Users who are viewing this thread

Back
Top Bottom