If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
A 2007... I dont WANT to save changes!
Hello again
Yes it does go away. It's actually a subroutine that is called to set the properties, and if I make the first line of the subroutine "exit sub" the problem goes away. I'm sorry I'm not allowed to post code (you're probably far too busy to look at other people's code anyway) but the function of the routine is to change international date and currency formats -- something that did not work correctly in A2002. You probably know that in 2002 when you specified a "currency" format, it actually got saved internally as $###,###... etc if you were coding in the US, and as £###,###... etc if you were coding in the UK. From then on, the app is stuck with that currency display format, regardless of the regional control panel settings. Consequently it is necessary to step through all controls on forms, looking for $### or £### format properties and changing them to "currency". A similar problem occurs with date formats. So the subroutine gets passed a form, and loops through all the controls... Anway I "solved" it by searching and replacing all "docmd.close acform, ______ " statements "docmd.close acform, _______ acsaveno". All 674 of them! Cheers Derek "Baz" wrote in message ... Hi Derek, And a Happy New Year to you also. Unfortunately I do not bear good tidings. I have tried what you say (including in a database converted from Access 2002) without experiencing this problem. Does the problem go away if you comment out the code which sets those properties? Baz "derek" wrote in message ... Baz - I don't know if you are stil monitoring this thread but I've tracked down the problem a bit further... It occurs whenever the code assigns an inputmask and format to a control that previously had no inputmask and format. Furthermore, this is an mdb database that was converted from A2002. (I don't know if that's important or not). In A2002 this did not trigger a "Save Changes" dialog. Apparently in 2007 it does. Happy new year Derek. "Baz" wrote in message ... It would be a mistake to think that this is a general issue with A2007, I've just tried it without any problem. Unfortunately I cannot offer any further suggestions as to why it is an issue for you. "derek" wrote in message ... Hi Bob-- Yes that's true but I would contest that if "Layout view" is disabled then changes to design at run-time should be impossible. In A2002 the same code gives no problem. Looks like I'll have to change thousands of docmd.close statements.... :-( Derek "Bob Quintal" wrote in message ... "derek" wrote in : Problem .. in an A2007 form I have an OK button that starts out disabled and gets enabled by code when certain things happen. This is all fine and according to plan. But whenever I close this form, A2007 asks me if I want to save changes. If I say YES, the state of the command button is saved as "enabled". Look I designed it this way for a darned good reason and I don't want Access changng the design of my forms every time they close, just because some properties have been changed since they opened. It's just not logical! The property "Enable Layout View" is disabled for this database, and the form property "Allow Layout View" is also set to No. How can I stop this behavior? Derek The DoCmd.Close statement has an optional parameter to save form design changes. It does not affect the saving of the data. DoCmd.Close , , acSaveNo -- Bob Quintal PA is y I've altered my email address. -- Posted via a free Usenet account from http://www.teranews.com |
#12
|
|||
|
|||
A 2007... I dont WANT to save changes!
Hi Derek,
Glad you fixed it, it's got me stumped! Baz "derek" wrote in message ... Hello again Yes it does go away. It's actually a subroutine that is called to set the properties, and if I make the first line of the subroutine "exit sub" the problem goes away. I'm sorry I'm not allowed to post code (you're probably far too busy to look at other people's code anyway) but the function of the routine is to change international date and currency formats -- something that did not work correctly in A2002. You probably know that in 2002 when you specified a "currency" format, it actually got saved internally as $###,###... etc if you were coding in the US, and as £###,###... etc if you were coding in the UK. From then on, the app is stuck with that currency display format, regardless of the regional control panel settings. Consequently it is necessary to step through all controls on forms, looking for $### or £### format properties and changing them to "currency". A similar problem occurs with date formats. So the subroutine gets passed a form, and loops through all the controls... Anway I "solved" it by searching and replacing all "docmd.close acform, ______ " statements "docmd.close acform, _______ acsaveno". All 674 of them! Cheers Derek "Baz" wrote in message ... Hi Derek, And a Happy New Year to you also. Unfortunately I do not bear good tidings. I have tried what you say (including in a database converted from Access 2002) without experiencing this problem. Does the problem go away if you comment out the code which sets those properties? Baz "derek" wrote in message ... Baz - I don't know if you are stil monitoring this thread but I've tracked down the problem a bit further... It occurs whenever the code assigns an inputmask and format to a control that previously had no inputmask and format. Furthermore, this is an mdb database that was converted from A2002. (I don't know if that's important or not). In A2002 this did not trigger a "Save Changes" dialog. Apparently in 2007 it does. Happy new year Derek. "Baz" wrote in message ... It would be a mistake to think that this is a general issue with A2007, I've just tried it without any problem. Unfortunately I cannot offer any further suggestions as to why it is an issue for you. "derek" wrote in message ... Hi Bob-- Yes that's true but I would contest that if "Layout view" is disabled then changes to design at run-time should be impossible. In A2002 the same code gives no problem. Looks like I'll have to change thousands of docmd.close statements.... :-( Derek "Bob Quintal" wrote in message ... "derek" wrote in : Problem .. in an A2007 form I have an OK button that starts out disabled and gets enabled by code when certain things happen. This is all fine and according to plan. But whenever I close this form, A2007 asks me if I want to save changes. If I say YES, the state of the command button is saved as "enabled". Look I designed it this way for a darned good reason and I don't want Access changng the design of my forms every time they close, just because some properties have been changed since they opened. It's just not logical! The property "Enable Layout View" is disabled for this database, and the form property "Allow Layout View" is also set to No. How can I stop this behavior? Derek The DoCmd.Close statement has an optional parameter to save form design changes. It does not affect the saving of the data. DoCmd.Close , , acSaveNo -- Bob Quintal PA is y I've altered my email address. -- Posted via a free Usenet account from http://www.teranews.com |
|
Thread Tools | |
Display Modes | |
|
|