Problem with saving changes on Table

Peter2222

Registered User.
Local time
Today, 19:02
Joined
Oct 26, 2005
Messages
14
Hi,

I've put a button on a form (lets say form 1), that when clicked opens up form 2.

Both forms are connected to ONE table each.

There is a sub table on form 2 that displays records with the same Id as on form 2.

The Problem is when I open The table that feeds the subtable. If I change the A to Z ordering on this table, whenever I close form 2 (not from design view, from user view), it asks me whether I want to save the changes to the design of the table feeding the sub table (the subtable that is on form 2, that is)?

When form 2 is closed there are calculations that are made and data is updated on form 1. I don't know if this is part of the problem? or perhaps I have set up the subtable incorrectly?

Please help!

Thanks

Peter
 
Last edited:
The prompt is asking if you want to save the new sort order with the form. If you don't want to see this prompt, you can add your own close button and in the Close method you can specify to close without saving.
 
re

thanks for the help, I tried that and that helps.

Also, I tried leaving the form as it is and I specified that the Order by property of the form to be [JobNumber] (- each record has a job number). this sorted out the problem for what ever ordering I have on the table. I really don't understand why though?
So table A could be ordered by field 2 for example, and then the form that contains the subtable (taken from the table A) could be ordered by field 1. I don't understand what's going on though? so is table A being ordered by field 1, and then when the form is opened, it gets ordered by field 2? but then why doesn't it ask me to save changes? haven't I just changed the order of table A again?
Any help is much appreciated
Peter.
 
You are not actually changing the order of the physical records in the tabl and the prompt to save was to save the sort property on the form. It had nothing to do with the data.

You never actually work with a table even if you open a table in datasheet view or use a table as the RecordSource of a form. You are actually viewing a recordset created by a query. Access is making the query for you "silently". The reason the order is not what you are expecting is because recordsets are unordered sets. The only way to give them a predictable order is to include an Order By clause.

Sorts are not "additive". If you want to include two columns in the sort sequence, you must either create a query that includes the order by clause and use that as the RecordSource for the form/report or if you want to sort on the fly, use the advanced sorting option from the menu.
 
Thanks for the reply, but why if it's just a recordset are we ever asked to save any changes?
 
I already said, twice, that you are not saving data. You are being asked if you want the form to remember the current sort order. This has nothing what so ever to do with saving data. Access automatically saves any changed data without prompting.

Recordsets created by queries in Access are not disconnected. If you update the data in them, the change passes through to the underlying table. It is possible to create a recordset which is not updatable but most records created by select queries are updatable.
 

Users who are viewing this thread

Back
Top Bottom