| View previous topic :: View next topic |
| Author |
Message |
Guillaume
Joined: 27 Nov 2008 Posts: 6 Location: Stuttgart
|
Posted: Thu Nov 27, 2008 9:57 am Post subject: How to control an Access-form |
|
|
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 |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
Posted: Thu Nov 27, 2008 10:30 am Post subject: |
|
|
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 |
|
 |
Guillaume
Joined: 27 Nov 2008 Posts: 6 Location: Stuttgart
|
Posted: Thu Nov 27, 2008 10:52 am Post subject: |
|
|
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 |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
Posted: Thu Nov 27, 2008 11:05 am Post subject: |
|
|
moin
| 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 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 |
|
 |
Guillaume
Joined: 27 Nov 2008 Posts: 6 Location: Stuttgart
|
Posted: Thu Nov 27, 2008 11:19 am Post subject: |
|
|
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 |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
Posted: Thu Nov 27, 2008 11:56 am Post subject: |
|
|
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  _________________ http://securityvision.ch
AHK 2D GAME ENGINE |
|
| Back to top |
|
 |
Guillaume
Joined: 27 Nov 2008 Posts: 6 Location: Stuttgart
|
Posted: Thu Nov 27, 2008 12:13 pm Post subject: |
|
|
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
am quite a beginner in this domain.
Thanks for your help. |
|
| Back to top |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
Posted: Thu Nov 27, 2008 12:45 pm Post subject: |
|
|
sure u can
| 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 |
|
 |
Guillaume
Joined: 27 Nov 2008 Posts: 6 Location: Stuttgart
|
Posted: Thu Nov 27, 2008 12:55 pm Post subject: |
|
|
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 |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
|
| Back to top |
|
 |
|