Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-13-2019, 11:39 AM   #1
eshai
Newly Registered User
 
Join Date: Jul 2015
Posts: 79
Thanks: 12
Thanked 4 Times in 4 Posts
eshai is on a distinguished road
Bringing Access to foreground

hi:
i build a db for register student automatically
in first process it take a photo of the student
so i'm using windows camera app with "sendkeys" but it stucks in the front
i tried using "setforegroundwindow" like this code from here https://access-programmers.co.uk/for...d.php?t=132129

but i get an error can't find dll entry point setforegroundwindow in user32
im using win 10 x64 and office 2016 x64 i add the "ptrsafe" to the code
can't find a way to bring access to the front. tried using "setfocus" "minimize"
"maximize" and other methods


Last edited by eshai; 02-13-2019 at 12:41 PM.
eshai is offline   Reply With Quote
Old 02-13-2019, 12:07 PM   #2
June7
Newly Registered User
 
June7's Avatar
 
Join Date: Mar 2014
Posts: 1,959
Thanks: 0
Thanked 463 Times in 459 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: Bringing Access to foreground

I faced a similar issue trying to coordinate Excel and Access. Needed the Excel to come to foreground. One of the reasons led me to eliminate Excel component which shouldn't have been there to begin with (inherited db mid-development).

Did you mean "ptrsafe"?

Very much doubt can do what you want.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 02-13-2019, 12:41 PM   #3
eshai
Newly Registered User
 
Join Date: Jul 2015
Posts: 79
Thanks: 12
Thanked 4 Times in 4 Posts
eshai is on a distinguished road
Re: Bringing Access to foreground

ya sorry i ment "ptrsafe" for the declaration on x64 system

maybe "sendkeys" alt+tab well work just how to hold the Alt key?

eshai is offline   Reply With Quote
Old 02-13-2019, 12:51 PM   #4
eshai
Newly Registered User
 
Join Date: Jul 2015
Posts: 79
Thanks: 12
Thanked 4 Times in 4 Posts
eshai is on a distinguished road
Re: Bringing Access to foreground

It worked fine
Code:
sendkeys "%{TAB}"
eshai is offline   Reply With Quote
Old 02-13-2019, 01:14 PM   #5
June7
Newly Registered User
 
June7's Avatar
 
Join Date: Mar 2014
Posts: 1,959
Thanks: 0
Thanked 463 Times in 459 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: Bringing Access to foreground

How can Access code know when you have finished using the camera? Post your code.

Review
https://bytes.com/topic/access/answe...re-windows-7-a
https://answers.microsoft.com/en-us/...5-f1aa2537e313

Okay, see you have found solution.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 02-13-2019, 01:31 PM   #6
eshai
Newly Registered User
 
Join Date: Jul 2015
Posts: 79
Thanks: 12
Thanked 4 Times in 4 Posts
eshai is on a distinguished road
Re: Bringing Access to foreground

[QUOTE]
Quote:
Originally Posted by June7 View Post
How can Access code know when you have finished using the camera? Post your code.
it's very simple i used timer event to take a picture and to popup the next form
so 5 sec to take the picture (zoom etc') and more 2 sec for ending the process
of saving the file

eshai is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bringing a button to the Foreground? LHolden Modules & VBA 10 07-26-2012 10:22 AM
Changing colour of foreground in an obj Hudson Forms 7 05-02-2011 09:45 AM
Bringing an open Access form in the background to the front tehNellie Forms 8 07-07-2010 06:43 PM
Open Word Doc in foreground patrickmcdiver Modules & VBA 1 02-23-2010 11:58 AM
Function to change foreground FoFa Modules & VBA 1 10-15-2004 02:02 PM




All times are GMT -8. The time now is 03:15 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World