By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,403 Members | 1,120 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,403 IT Pros & Developers. It's quick & easy.

Automate Access from Excel

P: 1
Hi All,

I have a requirement to automate Access functionality from Excel. I need to open Access, trigger button events and close Access from Excel.

I Achieved opening Access from Excel. I cannot find a way to trigger a button click event from Excel for an Access form.

To be more precise,
I have Access db called a.mdb. a.mdb has a.form and a.command button inside the form
I have xls sheet called b.xls. How I will fire an onclick event for a.command if I have already access a.form and a.mdb.


Any help greatly apprecaited, How a tight deadline coming up
Nov 7 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
When you open the access database. You need to open the form first.

DoCmd.OpenForm "frmName"

then you need to call the button click event as follows:

commandBtnName_OnClick


Hi All,

I have a requirement to automate Access functionality from Excel. I need to open Access, trigger button events and close Access from Excel.

I Achieved opening Access from Excel. I cannot find a way to trigger a button click event from Excel for an Access form.

To be more precise,
I have Access db called a.mdb. a.mdb has a.form and a.command button inside the form
I have xls sheet called b.xls. How I will fire an onclick event for a.command if I have already access a.form and a.mdb.


Any help greatly apprecaited, How a tight deadline coming up
Nov 7 '06 #2

NeoPa
Expert Mod 15k+
P: 31,768
I just tested that as I suspected that it wouldn't work because the event procedures on forms are always Private (I know - Oh ye of little faith!).
What I found was that the 'Forms("frmName").commandBtnName_OnClick' version doesn't work but that the 'Form_frmName.commandBtnName_OnClick' version does.
Nov 8 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
I just tested that as I suspected that it wouldn't work because the event procedures on forms are always Private (I know - Oh ye of little faith!).
What I found was that the 'Forms("frmName").commandBtnName_OnClick' version doesn't work but that the 'Form_frmName.commandBtnName_OnClick' version does.
Good catch.

Forgot it was private

Mary
Nov 8 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.