dbTalk Databases Forums  

Lookup table problem

comp.databases.ms-access comp.databases.ms-access


Discuss Lookup table problem in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniel Habtemariam
 
Posts: n/a

Default Lookup table problem - 04-19-2010 , 08:39 AM






Hi all--I know there's gotta be a simple answer to this...

I need to run a query, and depending on the results of the query, a
variable called Eligible should be set to either 0 or 1.

If there are no records returned, then the variable, Elligible, must
be set to 0; if there are one or more records returned, then Eligible
= 1.

Simple, right?

Other pertinent information: The query is a simple parameter query.
This is all in the context of VBA code on a form. The overall
objective is authenticate a data entry value on the form by looking up
whatever was entered against a table of acceptable values for that
variable.

Thanks in advance.

Reply With Quote
  #2  
Old   
Tom van Stiphout
 
Posts: n/a

Default Re: Lookup table problem - 04-19-2010 , 08:46 AM






On Mon, 19 Apr 2010 06:39:13 -0700 (PDT), Daniel Habtemariam
<dhabtem1 (AT) gmail (DOT) com> wrote:

Check out the DCount function. Your parameter goes in the
where-clause:
intCount = DCount("myField", "myQuery", "CustomerID=" & Me.CustomerID)

In many cases the alternative is to provide a dropdown with available
choices.

-Tom.
Microsoft Access MVP



Quote:
Hi all--I know there's gotta be a simple answer to this...

I need to run a query, and depending on the results of the query, a
variable called Eligible should be set to either 0 or 1.

If there are no records returned, then the variable, Elligible, must
be set to 0; if there are one or more records returned, then Eligible
= 1.

Simple, right?

Other pertinent information: The query is a simple parameter query.
This is all in the context of VBA code on a form. The overall
objective is authenticate a data entry value on the form by looking up
whatever was entered against a table of acceptable values for that
variable.

Thanks in advance.

Reply With Quote
  #3  
Old   
Daniel Habtemariam
 
Posts: n/a

Default Re: Lookup table problem - 04-20-2010 , 05:40 AM



Did the trick. Thanks Tom.

On Apr 19, 8:46*am, Tom van Stiphout <tom7744.no.s... (AT) cox (DOT) net> wrote:
Quote:
On Mon, 19 Apr 2010 06:39:13 -0700 (PDT), Daniel Habtemariam

dhabt... (AT) gmail (DOT) com> wrote:

Check out the DCount function. Your parameter goes in the
where-clause:
intCount = DCount("myField", "myQuery", "CustomerID=" & Me.CustomerID)

In many cases the alternative is to provide a dropdown with available
choices.

-Tom.
Microsoft Access MVP



Hi all--I know there's gotta be a simple answer to this...

I need to run a query, and depending on the results of the query, a
variable called Eligible should be set to either 0 or 1.

If there are no records returned, then the variable, Elligible, must
be set to 0; if there are one or more records returned, then Eligible
= 1.

Simple, right?

Other pertinent information: *The query is a simple parameter query.
This is all in the context of VBA code on a form. *The overall
objective is authenticate a data entry value on the form by looking up
whatever was entered against a table of acceptable values for that
variable.

Thanks in advance.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.