Union Queries

N

Natalie

Can I have a form based on a union query that allows me to update
information? Currently I have a union query (below) and I cannot updata
information in it? What am I doing wrong?

SELECT [User ID], [Company], [Status], [Address #], [Direction], [Address
Street Name], [Street Type], [Unit #],[City], [ZIP Code], [District],
[Contact], [Title], , [Phone], [Fax],[Oil & Grease BMP/Interceptor],
[Inspection Schedule], [Next Inspection Month], [Inspection Location
Grouping], [Interceptor], [BMP], [Interceptor Location], [Interceptor Size],
[Outside Waste Grease Bin Description], [Pump Interval (months)], [Service
Company], [Use Enzymes]
FROM [OG_Main From, Schedule, Interceptor Info]
WHERE [m_Facility Contact Info/Main Form].[Oil & Grease BMP/Interceptor]=yes

UNION ALL SELECT [User ID], [Tenant Name], [Status], [Address #],
[Direction], [Address Street Name], [Street Type], [Unit #/ Suite], [City],
[ZIP Code], [District], [Contact], [Title], [Email], [Phone], [Fax], [Oil &
Grease BMP/Interceptor], [Inspection Schedule], [Next Inspection Month],
[Inspection Location Grouping], [Interceptor], [BMP], [Interceptor Location],
[Interceptor Size], [Outside Waste Grease Bin Description], [Pump Interval
(months)], [Service Company], [Use Enzymes]
FROM [MT_Tenant Information Query]
WHERE [MT_Tenant Information Query].[Oil & Grease BMP/Interceptor] =yes;
 
N

Natalie

Okay, so if Union Queries are read only, how can I combine my two tables?
I have two forms:
Main Page -has a check box for O&G
Multi-Tenant Page- has a subform that has a check box for O&G

I need all addresses (main form and multi-tenant form addresses) to be
combined if they have a check for O&G wether it is checked on the main form
or on the subform. A union query works great, but then I can only read the
data. Both forms(tables) have the same fields and I need to combine them so I
can make another form that displays any record address that has a check box.
 
A

Allen Browne

It may be necessary for you to back up a few steps, and look at the bigger
picture.

You have something (landlords?) that have addresses.
You have something else (tenants?) that have addresses.
Then you have some kind of connection between these 2 entities (leases?)

I'm suggesting that you might consider the 2 types of entity that both have
addresses as being 'clients', and put them in the one table. This will avoid
the need for a UNION query.

Beyond that, I'm not clear what 'addresses' are in your case. Perhaps they
are properties to lease, in which case you would have a table with a record
for each property (where each property has its own address.) You would also
have a table of leases (where one property can be leased out many times over
the years.)
 
G

Gene DeJoie

Why am I getting all your messages??


No. Results of a UNION query will always be read-only.

The solution will probably to to combine your source tables into one,
possibly with an extra field to distinguish whatever is the difference
between them.
 
A

Allen Browne

Gene DeJoie said:
Why am I getting all your messages??

These messages are not being sent to you personally, but posted to Usenet
servers.

Perhaps you have configured the email software on your Apple Mac to read
certain news groups.

Or perhaps you posted a message using your real email address, which has
been picked up by spambots.
 

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