473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

2007 - Setting Format property in a datasheet at runtime -- prompt to save changes?

Hi - I've got an interesting one here:
I've got an mdb file that some users run in Access 2003 and some in 2007.
I have a Localize function that is called on the open of each form to set the captions and formatting to match the user's locale. One thing that I commonly do is set the Format property of text boxes that display date/time values to match the user's date/time preferences (i.e. m/d/yy or d/m/yy). It is not always an option for me to use Access' built-in "Short Date", "Medium Date", etc, formats - for instance, my most common format string is m/d/yy h:nn AM/PM).

If I have a form with a subform that is displayed in Datasheet mode, when I set the Format property of a textbox in the subform, then when I am done with the form and close it, I get a message asking me if I want to save the changes to my main form and my subform, even when running under the Access 2007 runtime.

Anyone seen this before, or have any suggestions for me? Attached is a sample db - open Form2 to observe the behavior.

Thanks!!
Nathan
Attached Files
File Type: zip Sample2.zip (20.8 KB, 136 views)
Nov 24 '09 #1
5 3630
just a quick follow up-

I realized I didn't explicitly say this in the detail, but the prompt to save changes only occurs in Access 2007; I'm running Access 2007 SP2.

A little more testing reveals that this happens on ANY form (whether it is a subform or not) that has the default view of Datasheet. So, setting the format property of a textbox (or other control) programmatically when the default form view is Datasheet is causing Access 2007 to issue a prompt to ask the user if he/she wants to save changes to the form when the form is closed.

I realize that I could add the acSaveNo parameter to a DoCmd.Close call - however, this is not great for the development environment (although I could add a switch related to if a developer is working on the system...), and I'm not sure how to handle forms that open as datasheets (and only have an X in the upper right) or subforms that get closed by the "parent" form, and thus don't have a DoCmd.Close call of their own.

Any suggestions would be appreciated! And I apologize if I led anyone down a bunny trail by not explicitly stating that the behavior only occurs in Access 2007!

Nathan
Nov 25 '09 #2
ChipR
1,287 Expert 1GB
I must be missing something. Why does your form have a Default View of Datasheet if you are using it to display text boxes?

Also, I can't at the moment think of a reason not to use the acSaveYes parameter.
Nov 25 '09 #3
NeoPa
32,556 Expert Mod 16PB
Surely TextBoxes are used in Datasheet view too Chip. No? I'm not completely sure as I never use it but I'd be very surprised if it work so much differently from other views.

As for saving the form every time a user is using the database, logging a completely misleading date for when the design of the form was last 'changed' is just one of many issues I can imagine might result from this.

Unfortunately, I can offer nothing either, relative to the vagaries of Access 2007 on this point Nathan. I certainly understand why you would be very careful about allowing such updates however.
Nov 25 '09 #4
ChipR
1,287 Expert 1GB
@nsbecker
Are your users getting a compiled version of the database with the source code removed? With the default acSavePrompt, a .accde file (or equivalent 2003) in runtime will just close and not give users this option, while the development version would.
Nov 25 '09 #5
NeoPa - right, it's not desirable to have the users always save the update. And I too was surprised that it works differently. My hunch is that it has something to do with Access 2007's enhanced datasheet properties (such as allowing users to add a totals row, etc) - i'll bet that the Format property is "special" when the form is in datasheet view, and thus by changing it, Access is thinking this must be a "major change" to the form design and therefore prompting the user if the change should be saved.

ChipR - chances are using an mde (2003 equivalent of an accde) would solve the problem. We have hesitated to make this move across the board b/c some of our customers like the ability to create custom queries and reports, etc. We probably could investigate some alternative methods of delivering our application that would still allow for this function, but this is not a small decision.

Thanks!
Nov 25 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any...
1
by: lgs | last post by:
In an application, I'm creating a QueryDef on the fly, then use DoCmd.OpenQuery to display the results. If the user changes column width, for example, s/he is prompted when closing whether s/he...
4
by: saintor1 | last post by:
Access 97 - I want the date format YYYY-M M-DD to show everywhere. My problem is that I deal with French and English versions. And don't want to play with Windows Regional Settings. In the...
5
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
2
by: beemomo | last post by:
Hi everyone. I used the BeforeUpdate event procedure to display a confirmation prompt and handle a user's response to either cancel or continue with the save as described in MSDN: Private Sub...
1
by: ncsthbell | last post by:
I have a dilemia, I have an application that I am having to make some changes to in order for it to run sucessfully under Runtime 2007. We are currently working on upgrading from 2000 to 2007. The...
4
by: infomage27 | last post by:
I have tried scripting this with rules and VBA, now trying with C# but still failing. (code is exploratory, so please excuse the terribleness) maybe someone here will show me the error of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.