Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve message from other table? 1

Status
Not open for further replies.

mpruett

Programmer
Jul 22, 2005
13
0
0
US
I'm stuck...

What I'm trying to do in Access is have a combo-box that gets its values from a Customer table, and if the user chooses to enter a Customer name that isn't already in the other table, then I want to open up another form for Customer maintenance.

My plan of attack is this:

I have the combo box working beautifully.

I'm thinking about some VBA code on the "On Exit" event of the combo box-

Something that'll let me do something like this
(pardon my wretched pseudocode!):

IF ComboBox.Customer IS NOT NULL AND
NOT CAN-FIND(ComboBox.Customer IN customer table)
then DoCmd.OpenForm(customer form)

Problem is, I don't know how to do the CAN-FIND part (and I know it's not a VBA command anyway).

Is there a way to use DoCmd.RunSQL to do somethign like this?

Thanks in advance,

Mark Pruett
 
Have a look at the LimitToList property and the NotInList event of the ComboBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top