473,748 Members | 2,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

5 New Member
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, 137 views)
Nov 24 '09 #1
5 3645
nsbecker
5 New Member
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) programmaticall y 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 Recognized Expert Top Contributor
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,570 Recognized Expert Moderator MVP
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 Recognized Expert Top Contributor
@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
nsbecker
5 New Member
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
3610
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 grid control. I tried many grid controls (DBGrid, DataGrid, MSFlexGrid), the ADO Data Control and everything I can think of, with no success. Here are the contraints I faced: (1) Populating any of the grid controls manually is too slow for my...
1
2105
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 wants to save the query. This doesn't work anyway, since it's just a temporary QueryDef, but I'd like to avoid the whole Save/Yes/No/Cancel dialog box entirely - it's just an annoying nuisance that could confuse some. The Updatable property of...
4
2738
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 format property of a control, it is easy to enter YYYY-MM-DD But it won't work in French versions. In them, AAAA-MM-JJ will. Using format(MyDate,"yyyy-mm-dd") in the controlsource doesn't sem to
5
7356
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 at the moment for queries but for datasheet forms I find that it automatically saves column positions and widths without prompting to save changes. I should mention i am using Access 2000
17
7666
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 do not, and it's not clear when they would get it. His thought was to use the upcoming Access 2007 runtime to allow the users who are still running Office 2003 to be able to run the database. While I use multiple versions of Access on my...
16
11133
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 know one way or the other whether that was true or not, or could point me to an article or help text that would. What I have seen so far online and in Access 2007 help seems to confirm the above. But that (or at least (b)) seems incredible that it...
2
2720
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 Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String Dim iResponse As Integer strMsg = "Do you wish to save the changes?" & Chr(10) strMsg = strMsg & "Click Yes to Save or No to Discard changes." iResponse = MsgBox(strMsg,...
1
5577
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 users will be running the apps under 'Runtime Access 2007' Here is my dilema... This application is used as a 'stand alone', basically, my users get a copy of the 'master' database and enter their data specifically for one account, each account they...
4
6463
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 code... sending an email by hand - everything works as expected (rules, VBA, etc are all applied). sending an email from code (C#, external VBA, etc) has the messages saving in Sent Items regardless of any other settings or configurations (up to...
0
8987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.