View Single Post
  #4  
Old May 20th, 2010, 02:01 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Parameter Query No Results - Needs to Auto Create Record

It is possible, yes, first thing which come to mind is :


SELECT * FROM query1
UNION ALL
SELECT MAX([Enter Customer ID:]) FROM someTable WHERE NOT EXISTS (SELECT *
FROM query1)


Which assumes that your actual query, query1, has only ONE column AND that
there is at least one record in the someTable you will refer to (but
otherwise, it is irrelevant of which table you use, at that point., but you
CANNOT use query1, for someTable, since that query MAY not return even one
record).



Vanderghast, Access MVP


"JudyKemp" wrote in message
...
I have a parameter query works as long as there are related records in the
tables. My problem is I when the query results are "null" or no records
exist I want the query to automatically create a new record based on the
parameter input. Is this possible?

Example:

[CustomerID] criteria shows Like "*" & [Enter Customer ID:] & "*"

If this is a new record for this Customer my query returns no values. I
want the query to automatically create a new record for this Customer or
show
all records related.

Your help is GREATLY appreciated!