Criteria in my table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To show an expression

Example..

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010,2020,2040))


This is suppose to say that the Loan Program = construction and if 2010,
2020 or 2040 shows that the code behind this will excute. Is this correct. It
is new creteria in a field in my table.
 
To show an expression

Example..

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010,2020,2040))


This is suppose to say that the Loan Program = construction and if 2010,
2020 or 2040 shows that the code behind this will excute. Is this correct. It
is new creteria in a field in my table.

What's the context, TKM? This is a valid query criterion, and - in an
appropriate query's WHERE clause - it will cause records to be retrieved if
they meet these criteria.

But it will not cause "code to be executed".

Secondly, you cannot put criteria *IN A TABLE* - only in a query.

What is the structure of your table, and what are you trying to accomplish?

John W. Vinson [MVP]
 
John,

Thanks for the reply. It is somwhat hard to explain but the way I see it

(The below is similar to the first one I sent)

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] NOT IN (2010,2020, 2030,
2040, 2050))

The above numbers represent propertys in a table and the Loan Program
represents certain areas like construction, painters, carpet etc. The other
numbers represent either multi family homes, commerical etc. What I am
looking for is a easy way to (I have 60 to do) write an expression that wil
either show certain records or not show certain records depending on what is
in the expression. Can you help me with this. I would greatly appreciate it.
You have helped me in the past and I truly appreciate it!.


John W. Vinson said:
To show an expression

Example..

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010,2020,2040))


This is suppose to say that the Loan Program = construction and if 2010,
2020 or 2040 shows that the code behind this will excute. Is this correct. It
is new creteria in a field in my table.

What's the context, TKM? This is a valid query criterion, and - in an
appropriate query's WHERE clause - it will cause records to be retrieved if
they meet these criteria.

But it will not cause "code to be executed".

Secondly, you cannot put criteria *IN A TABLE* - only in a query.

What is the structure of your table, and what are you trying to accomplish?

John W. Vinson [MVP]
 
One other quick question..

would this expression say if Construction is a match then do not show and of
the 2010, 2020 (properties)?


([LOANPROGRAM] = 'CONSTRUCTION') AND ([PROPTYPE] NOT IN (2010,2020, 2030,
2040, 2050))

Thank you very much!

TKM said:
John,

Thanks for the reply. It is somwhat hard to explain but the way I see it

(The below is similar to the first one I sent)

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] NOT IN (2010,2020, 2030,
2040, 2050))

The above numbers represent propertys in a table and the Loan Program
represents certain areas like construction, painters, carpet etc. The other
numbers represent either multi family homes, commerical etc. What I am
looking for is a easy way to (I have 60 to do) write an expression that wil
either show certain records or not show certain records depending on what is
in the expression. Can you help me with this. I would greatly appreciate it.
You have helped me in the past and I truly appreciate it!.


John W. Vinson said:
To show an expression

Example..

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010,2020,2040))


This is suppose to say that the Loan Program = construction and if 2010,
2020 or 2040 shows that the code behind this will excute. Is this correct. It
is new creteria in a field in my table.

What's the context, TKM? This is a valid query criterion, and - in an
appropriate query's WHERE clause - it will cause records to be retrieved if
they meet these criteria.

But it will not cause "code to be executed".

Secondly, you cannot put criteria *IN A TABLE* - only in a query.

What is the structure of your table, and what are you trying to accomplish?

John W. Vinson [MVP]
 
John,

I did not read your second half of the question. Yes this database is so
tangled up it has takenme over a week to dechiper it. The expression in this
mail is read by a code module and fires off the expression in a field name
LoanCriteria. It is a mess but it does work. A new department (construction)
does not want certain parts to run when they push the button. Yes these
expression are in a table and in a field named LoanCriteria. Does that make
sense?

John W. Vinson said:
To show an expression

Example..

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010,2020,2040))


This is suppose to say that the Loan Program = construction and if 2010,
2020 or 2040 shows that the code behind this will excute. Is this correct. It
is new creteria in a field in my table.

What's the context, TKM? This is a valid query criterion, and - in an
appropriate query's WHERE clause - it will cause records to be retrieved if
they meet these criteria.

But it will not cause "code to be executed".

Secondly, you cannot put criteria *IN A TABLE* - only in a query.

What is the structure of your table, and what are you trying to accomplish?

John W. Vinson [MVP]
 
John,

Here is the code that runs the table field..Review the other message I sent
you so it will make sense.

Thanks again and I will be waiting for your reply. Thanks again

While Not rstChecklist.EOF
rst.Open strSQL_LOan & " and " &
rstChecklist("LoanCriteria").Value, cn, adOpenDynamic, adLockOptimistic
If rst.EOF Then
rst.Close
GoTo next_item

John W. Vinson said:
To show an expression

Example..

([LOANPROGRAM] <> 'CONSTRUCTION') AND ([PROPTYPE] IN (2010,2020,2040))


This is suppose to say that the Loan Program = construction and if 2010,
2020 or 2040 shows that the code behind this will excute. Is this correct. It
is new creteria in a field in my table.

What's the context, TKM? This is a valid query criterion, and - in an
appropriate query's WHERE clause - it will cause records to be retrieved if
they meet these criteria.

But it will not cause "code to be executed".

Secondly, you cannot put criteria *IN A TABLE* - only in a query.

What is the structure of your table, and what are you trying to accomplish?

John W. Vinson [MVP]
 
John,

Here is the code that runs the table field..Review the other message I sent
you so it will make sense.

Thanks again and I will be waiting for your reply. Thanks again

While Not rstChecklist.EOF
rst.Open strSQL_LOan & " and " &
rstChecklist("LoanCriteria").Value, cn, adOpenDynamic, adLockOptimistic
If rst.EOF Then
rst.Close
GoTo next_item

I'm sorry, TKM, we seem to be speaking different languages altogether.

Code does not "run a table field". A table field is a static, stored piece of
data.

Your code is opening a Query (presumably previously defined in the code using
the variable name strSQL_Loan) and adjusting its parmeters. I don't know
what's in strSQL_Loan, I don't know what rstChecklist is, I don't know what
the value of LoanCriteria might be...

I'm GUESSING that strSQL_Loan is some sort of action query that creates new
records or edits records, but I really don't know.

I strongly suggest that you need to get some professional help to untangle
this (apparent) mess of a database. If the shadowy view I have of portions of
the database is any indication, it's *either* a real mess that needs to be
largely redone - *or* an elegant, tricky, complex code-dependent work of art.
In either case, just seeing little snippets of it isn't going to let me fix
the problems.

John W. Vinson [MVP]
 
One other quick question..

would this expression say if Construction is a match then do not show and of
the 2010, 2020 (properties)?


([LOANPROGRAM] = 'CONSTRUCTION') AND ([PROPTYPE] NOT IN (2010,2020, 2030,
2040, 2050))

This criterion in a Query - and again, you haven't shown me how it fits into a
query, see my other message - will show all records where LOANPROGRAM contains
the text string CONSTRUCTION, *unless* the PROPTYPE is one of the five values
listed. It will show records where PROPTYPE has any other non-null value.

John W. Vinson [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

Similar Threads


Back
Top