NUMBER DOES NOT EXIST

P

pauld

I am using a combo box to search a table for a particular number (table field
name is EmployeeNumber)

If the number I type into the combo box doesn't exist, how do I get Acess to
give me a message that says something like "That Number does not exist"?

Is is a setting of the EmployeeNumber field in the table? Or is there a
Macro that is needed to look for that value and report that it's not there?
 
P

pietlinden

I am using a combo box to search a table for a particular number (table field
name is EmployeeNumber)

If the number I type into the combo box doesn't exist, how do I get Acessto
give me a message that says something like "That Number does not exist"?

Is is a setting of the EmployeeNumber field in the table? Or is there a
Macro that is needed to look for that value and report that it's not there?

use DCount. If DCount(...)=0 then MsgBox...
 
S

Steve Sanford

Readup on the "NotInList" event. This is where you would put the code for a
message box alert.

HTH
 
P

pauld

I must not understand the advice you provided.

I changed the Macro I use to populate the form based on the EmployeeNumber I
select in the combo box to make it Conditional.

I entered what you advised and Access says it can't parse the expression.

I should also say that I have an EmployeeNumber of 00000 so that when I open
the Form the fields are blank because it's showing data for that
EmployeeNumber. I do this to be sure the user has a "blank" Form to begin
with.

I also looked for DCount in Access Help and got a message saying help
doesn't exist in English.
 
P

pauld

The "NotInList" event is not available under MS Access Help.

The message says it doesn't exist in my language (English).

Is there another location I can find the info on this event?
 
L

Larry Linson

The Help for NotInList does exist in English language Help, in every version
of Access. In Design View, click on that Control, right-click and Select
Properties, then in the Data tab, place your cursor on the "Limit to List"
line and press F1. There is also a "Not in List" event, on which you can do
the same. There's likely more Help on the Not In List event in the code
window.

If your installation of Access does not have this information available in
Help, you may have a failed install that didn't (properly) install Help, or
you may be trying to use Access 2003, for which Online Help is primary,
without being connected to the Internet.

Larry Linson
Microsoft Office Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top