473,761 Members | 4,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access: Sendkeys and Vista

2 New Member
I am upgrading a long-standing Access application from 97, Xp and a 1280x1024 screen to 2000 ( and eventually 2007), Vista Business and 1280x800. The application has been in frequent use for many years and has several thousand lines of code 'behind' the various forms so that the users do not actually know they are using Access.

At various times I use
Expand|Select|Wrap|Line Numbers
  1. Sendkeys "+{Enter}", True 
to force an update of the underlying data tables.

Attempting to run the 97 version under Vista I get >> Run-time error 70 Permission Denied << at the sendkeys line. I have checked that the user has full control permission to all the files involved and also that the various files are not read-only. The problem is presumably Vista related as it works as expected under XP.
Sep 28 '07 #1
5 4866
Scott Price
1,384 Recognized Expert Top Contributor
I am upgrading a long-standing Access application from 97, Xp and a 1280x1024 screen to 2000 ( and eventually 2007), Vista Business and 1280x800. The application has been in frequent use for many years and has several thousand lines of code 'behind' the various forms so that the users do not actually know they are using Access.

At various times I use
Expand|Select|Wrap|Line Numbers
  1. Sendkeys "+{Enter}", True 
to force an update of the underlying data tables.

Attempting to run the 97 version under Vista I get >> Run-time error 70 Permission Denied << at the sendkeys line. I have checked that the user has full control permission to all the files involved and also that the various files are not read-only. The problem is presumably Vista related as it works as expected under XP.
I'm not positive about Vista, but I am positive that when eventually landing in Access 2007 you will experience troubles with the SendKeys function. They are part of the disabled-because-of-security-reasons set of very useful functions that will no longer work!

This thread has a few links and suggestions that will be helpful to you:

http://www.thescripts.com/forum/thre...-sendkeys.html

Fortunately there are other ways to do what you are describing.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdSave
works, or

Expand|Select|Wrap|Line Numbers
  1. If Me.Dirty = True Then  
  2.     Me.Dirty = False 
  3. End If
Regards,
Scott
Sep 28 '07 #2
FishVal
2,653 Recognized Expert Specialist
Hi, John.

Using SendKeys is not very good habit and practice at all.
There are many other more conventional ways to do the same:
  • Form.Refresh method
  • Form.Requery method (needs additional coding to return back to the record)
  • DoCmd.RunComman d acCmdSaveRecord
Sep 28 '07 #3
Scott Price
1,384 Recognized Expert Top Contributor
Beat you to it today Fish! Thanks for your too, though :-)

Regards,
Scott
Sep 28 '07 #4
John Melbourne
2 New Member
Scott and Fish

Thanks Guys It's now working

PS Though Scott got in first actually Fish' solution of acCmdSaveRECORD is a more accurate equivalent to +{enter}
Sep 28 '07 #5
Scott Price
1,384 Recognized Expert Top Contributor
Scott and Fish

Thanks Guys It's now working

PS Though Scott got in first actually Fish' solution of acCmdSaveRECORD is a more accurate equivalent to +{enter}
You are correct :-) acCmdSaveRecord is the more accurate equivalent.

Glad it's working for you!

Regards,
Scott
Sep 28 '07 #6

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

Similar topics

0
2838
by: Jack | last post by:
Windows 2K Pro Access/Excel 2003 Hi there, I have a large number of password protected Excel Workbooks. The files are protected by code that runs when the workbook opens. The code asks the user to key in a password into an input box, the password is compared to a a partciular cell on a hidden (xlVeryHidden) sheet and if it matches the Workbooks opens. I have not used the usual Excel password protection as I need to provide for several...
1
2241
by: Glenn Palomar | last post by:
Hi, I have a beta Vista system and I'm running a program (created in VB.net) that sends keystroke to an application using System.Windows.Forms.SendKeys.SendWait. In Vista it throws an exception - System.Security.SecurityException: Hook cannot be created. Is there a way to workaround this problem? I'm logged-in as the system administrator.
0
1780
by: Licantrop0 | last post by:
....with description: " Hook cannot be created" My little program should open an IE window on a specific site, then write in some parameters (with sendkeys function) to login automatically in the page. On XP and IE6 all worked perfectly, but with XP+IE7, sendkeys do not works anymore (any error given), and with Vista here is the SecurityException
17
7647
by: rdemyan | last post by:
My app creates a building report. My users have requested that I provide functionality to e-mail these "building reports" to building managers once a month. So assuming that I have the following table that lists a building manager's name, e-mail address and their building, is there a way that I can automate this to send these monthly e-mails from Outlook. Ideally this would be a click one button type of action:
0
2767
by: dtshedd | last post by:
I have a database with hundreds of embedded photos (Microsoft Photo 3.0) Many are larger than 1 MB. I tried Stephen Lebans macro but it did not work probably for the aforementioned reasons Now I am trying to use the copy portion of Stephens macro and then open MS Paint using Sendkeys to Paste and save. The Sendkeys method is opening the Paint app but not executing the paste command. Wondering what I am doing wrong. I have only ever...
0
1090
by: anuragshrivastava64 | last post by:
Can anyone please tell me how to use SendKeys in Vista?
0
1392
by: onowic | last post by:
Hi All, When my users view a report the report is opened on their screen in Print Preview. In each report I have a customized ToolBar with navigation buttons to go to the Next Page or Previous Page for previewing. My users seem to prefer the buttons over the page control located at the bottom left of the reports.
5
13049
by: =?Utf-8?B?U3JpbWFu?= | last post by:
Hi, We are launching .net window from vb6 form. In .net form tabbing(tab out from one control to another control) was not working. for that i have written a code like Sendkeys.send("{TAB}") in the textbox keypress event. I got the following error msg: {"SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait...
3
2212
by: derfer | last post by:
I am trying to import a .inf file into access (the file comes from the output of some 3rd party software). I have managed to convert the file by opeing it in notepad and re-saving then a seperate script to open the txt file and import. Both these scripts seem to work well (ish) but is there a better way of doing this? and is there a way of doing this and only having to run a single script? Copies of the script below. Any help would be much...
0
9377
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
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
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
9811
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...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
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();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
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

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.