Bringing Access to foreground (1 Viewer)

eshai

Registered User.
Local time
Today, 03:52
Joined
Jul 14, 2015
Messages
193
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/forums/showthread.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 :banghead:
 
Last edited:

June7

AWF VIP
Local time
Yesterday, 16:52
Joined
Mar 9, 2014
Messages
5,470
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.
 

eshai

Registered User.
Local time
Today, 03:52
Joined
Jul 14, 2015
Messages
193
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

Registered User.
Local time
Today, 03:52
Joined
Jul 14, 2015
Messages
193
It worked fine
Code:
sendkeys "%{TAB}"
 

eshai

Registered User.
Local time
Today, 03:52
Joined
Jul 14, 2015
Messages
193
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
 

Users who are viewing this thread

Top Bottom