473,385 Members | 1,780 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,385 software developers and data experts.

Access: Sendkeys and Vista

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 4842
Scott Price
1,384 Expert 1GB
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 Expert 2GB
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.RunCommand acCmdSaveRecord
Sep 28 '07 #3
Scott Price
1,384 Expert 1GB
Beat you to it today Fish! Thanks for your too, though :-)

Regards,
Scott
Sep 28 '07 #4
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 Expert 1GB
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
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...
1
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...
0
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...
17
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...
0
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...
0
by: anuragshrivastava64 | last post by:
Can anyone please tell me how to use SendKeys in Vista?
0
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...
5
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...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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,...

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.