Update DB Form with Excel VBA

oravec

Board Regular
Joined
Apr 15, 2003
Messages
65
Hello,

I need to be able to simulate pressing Tab key twice and the Press Enter Key to close form and have DB run its internal macro.

Is there code that will do this.

I am trying to automatically update a .mde file with data from Excel. So far I have learned how to open DB and open the first form I need to update with the following code. When form closes it runs a macro in the DB. The last line of code successfully closes form, but doesn't cause DB macro to run.


Dim db As Access.Application
Sub test_opendb()

Set db = New Access.Application
db.OpenCurrentDatabase "c:\Program Files\opsnet\Opsnet20.mde"
db.Application.Visible = True

DoCmd.RunMacro "macLogin" 'this opens Logon Form

DoCmd.Close acForm, "FrmLogin", acSaveYes 'closes form,doesn't update

Thanks,
Cliff
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,221,550
Messages
6,160,459
Members
451,648
Latest member
SuziMacca

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top