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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Halp!!!

Status
Not open for further replies.

talsh

IS-IT--Management
Jun 8, 2003
14
IL
I want to create table with constant data and query that just read from it but not update.

How can I promising that the constant table will be not updates from this query?


Thanks in advanced
 
Are you opening your query from a forms command button? If so, place the following behind your command button:

DoCmd.OpenQuery "NameOfYourQuery", acViewNormal, acReadOnly

You can also create a report based on your query.

 
A regular select query can't change table data. If your looking at the data through a form based on the query, go to the form's design view, bring up the property sheet for the form and change Allow Edits, Allow Deletions, Allow Additions to NO.
 
A regular select query does allow you to change data unless you specifiy acReadOnly upon opening it. Test it out by running a query under you query tab and change something in a field. It will change the tables data.

 
All these are good but not solve my problem:

I'm trying to make relationship between two (and more) tables for query.

I need to read from one table the data but not write to it.
The ID row will be linked to the other table (this table will be update with the number of the ID).

Until now I have success to make relationship between them but both of the table are updated.
 
Not clear what you are trying to accomplish here.

- Do you have a form that is displaying the data from your query? Meaning, is your query the forms record source?

- Are you using the form to update the data in the table?

- If so, can you paste your queries sql here?
 
I'm not must to work with form, it is also happend with my query.

please help to get the queries sql and I'll paste it
 
- Open your query in design view.
- Go to View on the toolbar and choose SQL View.
- Copy the sql and paste it into this post.
 
Oops. HP you're right. I always create forms for my recordsets 'cause most of the people using my stuff know little about Access, or enough to cause trouble, and I can "lock" them out. Of course, I hide the queries, too.
 
Here is my SQL

SELECT Sale.[Family Name], Sale.[First Name], Sale.[Home Phone], Sale.[Cell Phone], Sale.[2nd Cell Phone], Sale.[Work Phone], Sale.ID, t_Asset.r_Asset, Sale.Rooms, t_City.r_City, Sale.Neighborhood, Sale.Street, Sale.[Build Number], Sale.Apartment, Sale.Price, Sale.[Old Price], Sale.Floor, Sale.Floors, Sale.[Surface Build], Sale.[Surface Yard], Sale.North, Sale.South, Sale.East, Sale.West, Sale.Level, Sale.Basement, Sale.Roof, Sale.Apartments, Sale.Age, Sale.Block, Sale.Part, Sale.Arbitration, Sale.Eviction, Sale.Source, Sale.Agent, Sale.StockpileNo, Sale.StockPileUPD, Sale.PublishAgain, Sale.LastPublish, Sale.Remind, Sale.DateUPD, t_Addin.r_Addin, t_Aircondition.r_Aircondition, t_ExclusiveYesNo.[r_Yes-No], t_OfferYesNo.[r_Yes-No], t_Status.r_Status, t_UrgentYesNo.[r_Yes-No], t_Parking.r_Parking, t_PublishYesNo.[r_Yes-No], t_Side.r_Side, t_KeyHoldYesNo.[r_Yes-No], t_Kitchen.[r-Kitchen], t_Land.r_Land, t_Bathroom.r_Bathroom, t_Boiler.[r-Boiler], t_ElevatorYesNo.[r_Yes-No], Sale.OpenDate, Sale.Comment
FROM (t_UrgentYesNo RIGHT JOIN (t_Status RIGHT JOIN (t_Side RIGHT JOIN (t_PublishYesNo RIGHT JOIN (t_Parking RIGHT JOIN (t_OfferYesNo RIGHT JOIN (t_Land RIGHT JOIN (t_Kitchen RIGHT JOIN (t_KeyHoldYesNo RIGHT JOIN (t_ExclusiveYesNo RIGHT JOIN (t_ElevatorYesNo RIGHT JOIN (t_Boiler RIGHT JOIN (t_Bathroom RIGHT JOIN (t_Aircondition RIGHT JOIN (t_Addin RIGHT JOIN (t_City RIGHT JOIN Sale ON t_City.Index = Sale.City) ON t_Addin.Index = Sale.Addin) ON t_Aircondition.Index = Sale.Aircondition) ON t_Bathroom.Index = Sale.Bathroom) ON t_Boiler.Index = Sale.Boiler) ON t_ElevatorYesNo.Index = Sale.Elevator) ON t_ExclusiveYesNo.Index = Sale.Exclusive) ON t_KeyHoldYesNo.Index = Sale.KeyHolding) ON t_Kitchen.Index = Sale.Kitchen) ON t_Land.Index = Sale.Land) ON t_OfferYesNo.Index = Sale.Offer) ON t_Parking.Index = Sale.Parking) ON t_PublishYesNo.Index = Sale.Publish) ON t_Side.Index = Sale.Side) ON t_Status.Index = Sale.Status) ON t_UrgentYesNo.Index = Sale.Urgency) LEFT JOIN t_Asset ON Sale.Asset = t_Asset.Index;
 
For example the table t_Asset is need to be constant but the record t_Asset.r_Asset is updateing each time I have updating the Sale table thru the query.

How can I change it to not updateable.

Thanks in advanced.
 
I still don't understand how you are updating the Sale table through the query. Are you running the query directly and then changing data directly in the query results? Or, are you using the query in a form and updating it with the form?
 
I'm updating the query with form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top