AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to control an Access-form

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guillaume



Joined: 27 Nov 2008
Posts: 6
Location: Stuttgart

PostPosted: Thu Nov 27, 2008 9:57 am    Post subject: How to control an Access-form Reply with quote

Hi,

Is there any possibility to control a specific form of an access database? For example, I'd like to open a particular form of my application pressing a key. BTW, is it possible to open a form without displaying the access environment all around (which could run in the background...)?

Thank you all for your help

Guillaume
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Thu Nov 27, 2008 10:30 am    Post subject: Reply with quote

Why use Autohotkey and not Visual Basic which is directly implemented in access...?

Quote:
BTW, is it possible to open a form without displaying the access environment all around (which could run in the background...)?

Don't think so. But, you can restric access to tables, forms and other functions in the properties.
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
Guillaume



Joined: 27 Nov 2008
Posts: 6
Location: Stuttgart

PostPosted: Thu Nov 27, 2008 10:52 am    Post subject: Reply with quote

Grüezi!

Thanks for your reply.

Of course, I use vba in my application, but I can't access the vba functions while being in an other applicaiton than Office. For example, I am in Firefox and I'd like to check or add something in my DB, I press a key and the form I want gets opened directly.
Do you know what I mean? I just want to know if there is a way of accessing a specific form of the DB with AHK.
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Thu Nov 27, 2008 11:05 am    Post subject: Reply with quote

Quote:
Grüezi!

moin Very Happy

Quote:
Of course, I use vba in my application, but I can't access the vba functions while being in an other applicaiton than Office. For example, I am in Firefox and I'd like to check or add something in my DB, I press a key and the form I want gets opened directly.
Do you know what I mean? I just want to know if there is a way of accessing a specific form of the DB with AHK.

I see.
Well, u can use ADO COM Library from sean Arrow http://www.autohotkey.com/forum/topic16565.html for direct acess the DB.

Or, u can redirect a (global) hotkey with AHK to the Access form (send the keys to the Access-Window-Form which may be hidden or minimized)
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
Guillaume



Joined: 27 Nov 2008
Posts: 6
Location: Stuttgart

PostPosted: Thu Nov 27, 2008 11:19 am    Post subject: Reply with quote

Hi and thanks again!

Quote:
Or, u can redirect a (global) hotkey with AHK to the Access form (send the keys to the Access-Window-Form which may be hidden or minimized)


Yes! That's exactly what I'd like to do but I don't know the command for it.
For example, if I write Run, xyz.mdb, it will run the application but how can I specify the form to be shown?
Do you know it?

Merci!

Guillaume
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Thu Nov 27, 2008 11:56 am    Post subject: Reply with quote

I would say u can simply use commandline switches for access: here is a german list: arrow: http://support.microsoft.com/kb/209207

Quote:
/x Makro Startet Access und führt das angegebene Access-
Makro aus. Eine andere Methode zum Datenbank oder
Ausführen eines Makros beim Öffnen Access-
einer Datenbank ist die Verwendung Projekt
eines AutoExec-Makros.

so u can start a macro which can open your form... have fun Very Happy
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
Guillaume



Joined: 27 Nov 2008
Posts: 6
Location: Stuttgart

PostPosted: Thu Nov 27, 2008 12:13 pm    Post subject: Reply with quote

Thanks again. It sounds interesting.

Just a question: can I use these commandlines with or through AHK?
I mean, I'd like to assign an hotkey to different forms, so that the key Y opens the form YYY and the key X, the form XXX.

Am sorry if my questions appear a bit silly Embarassed
am quite a beginner in this domain.

Thanks for your help.
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Thu Nov 27, 2008 12:45 pm    Post subject: Reply with quote

sure u can Smile

Code:

;define some Variables:
PathToAccess := "C:\Programme\Access.exe"
PathToMDB := "C:\dbs\my.mdb"
return ;end of autoexecution

;define a hotkey:
#a:: ;[win] + [A] starts makro1
 run, %comspec% \c "%PathToAccess%" "%PathToMDB%" /x makro1
return

#b:: ;[win] + [B] starts makro2
 run, %comspec% \c "%PathToAccess%" "%PathToMDB%" /x makro2
return

So, u have to create the makros one and two, and let them open (form.show maby, not sure) your desired forms...
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
Guillaume



Joined: 27 Nov 2008
Posts: 6
Location: Stuttgart

PostPosted: Thu Nov 27, 2008 12:55 pm    Post subject: Reply with quote

Great!!

Thank you very much, that's what I tried to do without success, now I know how to proceed
Thanks once again for your help.

Guillaume
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Thu Nov 27, 2008 1:24 pm    Post subject: Reply with quote

Quote:
Thanks once again for your help.

always a pleasure Wink
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group